Skip to content

Commit

Permalink
Code format tidy for main/*.F90.
Browse files Browse the repository at this point in the history
  • Loading branch information
yuanhuas committed Feb 17, 2025
1 parent d604b6d commit 0f3a6fc
Show file tree
Hide file tree
Showing 51 changed files with 452 additions and 461 deletions.
2 changes: 1 addition & 1 deletion main/BGC/MOD_BGC_CNAnnualUpdate.F90
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ MODULE MOD_BGC_CNAnnualUpdate
! !ORIGINAL:
! The Community Land Model version 5.0 (CLM5.0)

! !REFERENCE:
! !REFERENCES:
! Lawrence, D.M., Fisher, R.A., Koven, C.D., Oleson, K.W., Swenson, S.C., Bonan, G., Collier, N.,
! Ghimire, B., van Kampenhout, L., Kennedy, D. and Kluzek, E., 2019.
! The Community Land Model version 5: Description of new features, benchmarking,
Expand Down
2 changes: 1 addition & 1 deletion main/BGC/MOD_BGC_CNSASU.F90
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ MODULE MOD_BGC_CNSASU
! !ORIGINAL:
! The Community Land Model version 5.1 (CLM5.1) unreleased version developed by Xingjie Lu
!
! !REFERENCE:
! !REFERENCES:
! Lu, X., Du, Z., Huang, Y., Lawrence, D., Kluzek, E., Collier, N., Lombardozzi, D., Sobhani, N., Schuur, E.A. and Luo, Y., 2020.
! Full implementation of matrix approach to biogeochemistry MODULE of CLM5. Journal of Advances in Modeling Earth Systems, 12(11), e2020MS002105.
! Liao, C., Lu, X., Huang Y., Tao F., Lawrence, D., Koven C., Oleson, K., Wieder, W., Kluzek, E., Huang, X., Luo, Y. (in submission)
Expand Down
2 changes: 1 addition & 1 deletion main/BGC/MOD_BGC_Soil_BiogeochemDecompCascadeBGC.F90
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ MODULE MOD_BGC_Soil_BiogeochemDecompCascadeBGC
! !DESCRIPTION:
! Calculate the soil decomposition rate according to soil temperature, soil matric potential, and depth
!
! !REFERENCE:
! !REFERENCES:
! Koven, C.D., Riley, W.J., Subin, Z.M., Tang, J.Y., Torn, M.S., Collins, W.D., Bonan, G.B., Lawrence,
! D.M. and Swenson, S.C., 2013. The effect of vertically resolved soil biogeochemistry and alternate
! soil C and N models on C dynamics of CLM4. Biogeosciences, 10(11), 7109-7131.
Expand Down
2 changes: 1 addition & 1 deletion main/BGC/MOD_BGC_Soil_BiogeochemLittVertTransp.F90
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ MODULE MOD_BGC_Soil_BiogeochemLittVertTransp
! Simulate the soil and litter CN vertical mixing (diffusion and advection) processes. Solve the dynamics
! of soil and litter vertical profile with a tridiagonal matrix.
!
! !REFERENCE:
! !REFERENCES:
! Koven, C.D., Riley, W.J., Subin, Z.M., Tang, J.Y., Torn, M.S., Collins, W.D., Bonan, G.B., Lawrence,
! D.M. and Swenson, S.C., 2013. The effect of vertically resolved soil biogeochemistry and alternate
! soil C and N models on C dynamics of CLM4. Biogeosciences, 10(11), 7109-7131.
Expand Down
2 changes: 1 addition & 1 deletion main/BGC/MOD_BGC_Soil_BiogeochemNitrifDenitrif.F90
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ MODULE MOD_BGC_Soil_BiogeochemNitrifDenitrif
! !DESCRIPTION:
! Calculate the potential nitrification and dentrification rate.
!
! !REFERENCE:
! !REFERENCES:
! Parton, W. et al. 1996. Generalized model for N2 and N2O production from nitrification and
! denitrification. Global Biogeochemical Cycles 10(3):401-412.
! Parton, W.J. et al. 2001. Generalized model for NOx and N2O emissions from soils. J. Geophys. Res.
Expand Down
2 changes: 1 addition & 1 deletion main/BGC/MOD_BGC_Soil_BiogeochemPotential.F90
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ MODULE MOD_BGC_Soil_BiogeochemPotential
! transfer (p_decomp_cpool_loss * cn_decomp_pools(donor))
! p_decomp_cpool_loss and pmnf_decomp are THEN used in bgc_soil_SoilBiogeochemDecompMod.F90
!
! !REFERENCE:
! !REFERENCES:
! Thornton, P.E., Law, B.E., Gholz, H.L., Clark, K.L., Falge, E., Ellsworth, D.S., Goldstein, A.H., Monson,
! R.K., Hollinger, D., Falk, M. and Chen, J., 2002. Modeling and measuring the effects of disturbance
! history and climate on carbon and water budgets in evergreen needleleaf forests.
Expand Down
2 changes: 1 addition & 1 deletion main/BGC/MOD_BGC_Veg_CNFireBase.F90
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ MODULE MOD_BGC_Veg_CNFireBase
! This MODULE calculate fire-induced vegetation and litter CN transfers flux, the calculation is based on the fire-induced
! CN loss rates (f). The CN loss rates (f) is calculated from bgc_veg_CNFireLi2016Mod.F90.
!
! !REFERENCE:
! !REFERENCES:
! Li, F., Levis, S., and Ward, D. S. 2013a. Quantifying the role of fire in the Earth system – Part 1: Improved global fire
! modeling in the Community Earth System Model (CESM1). Biogeosciences 10:2293-2314.
! Li, F., and Lawrence, D. 2017. Role of fire in the global land water budget during the 20th century through changing
Expand Down
2 changes: 1 addition & 1 deletion main/BGC/MOD_BGC_Veg_CNFireLi2016.F90
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ MODULE MOD_BGC_Veg_CNFireLi2016
! This module calculate burned area of each fire. The burned area is used to calculate fire induced CN loss rates
! in bgc_veg_CNFireBaseMod.F90
!
! !REFERENCE:
! !REFERENCES:
! Li, F., Levis, S., and Ward, D. S. 2013a. Quantifying the role of fire in the Earth system – Part 1: Improved global fire
! modeling in the Community Earth System Model (CESM1). Biogeosciences 10:2293-2314.
! Li, F., and Lawrence, D. 2017. Role of fire in the global land water budget during the 20th century through changing
Expand Down
2 changes: 1 addition & 1 deletion main/BGC/MOD_BGC_Veg_CNGResp.F90
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ MODULE MOD_BGC_Veg_CNGResp
! !DESCRIPTION:
! This module calculate growth respiration rate.
!
! !REFERENCE:
! !REFERENCES:
! Atkin, O.K., Bahar, N.H., Bloomfield, K.J., Griffin, K.L., Heskel, M.A., Huntingford, C., de la Torre, A.M.
! and Turnbull, M.H., 2017. Leaf respiration in terrestrial biosphere models. Plant respiration: metabolic
! fluxes and carbon balance, pp.107-142.
Expand Down
2 changes: 1 addition & 1 deletion main/BGC/MOD_BGC_Veg_CNMResp.F90
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ MODULE MOD_BGC_Veg_CNMResp
! !DESCRIPTION:
! This module calculates plant maintenance respiration
!
! !REFERENCE:
! !REFERENCES:
! Atkin OK, Bloomfield KJ, Reich PB, Tjoelker MG, Asner GP, Bonal D et al (2015) Global variability in leaf respiration
! in relation to climate, plant functional types and leaf traits. New Phytologist 206:614–636
!
Expand Down
2 changes: 1 addition & 1 deletion main/BGC/MOD_BGC_Veg_CNNDynamics.F90
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ MODULE MOD_BGC_Veg_CNNDynamics
! This MODULE simulates the plant biological fixation (Cleveland et al., 1999),
! crop fertilisation (Lawrence et al., 2016, and soy nitrogen fixation (Neitsch et al., 2005).
!
! !REFERENCE:
! !REFERENCES:
! Cleveland, C.C., Townsend, A.R., Schimel, D.S., Fisher, H., Howarth, R.W., Hedin, L.O., Perakis, S.S., Latty, E.F.,
! Von Fischer, J.C., Elseroad, A., and Wasson, M.F. 1999. Global patterns of terrestrial biological nitrogen (N2) fixation
! in natural ecosystems. Global Biogeochem. Cycles 13:623-645.
Expand Down
2 changes: 1 addition & 1 deletion main/BGC/MOD_BGC_driver.F90
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ SUBROUTINE bgc_driver (i,idate,deltim,dlat,dlon)
! !ORIGINAL:
! The Community Land Model version 5.0 (CLM5.0)
!
! !REFERENCE:
! !REFERENCES:
! Lawrence, D.M., Fisher, R.A., Koven, C.D., Oleson, K.W., Swenson, S.C., Bonan, G., Collier, N.,
! Ghimire, B., van Kampenhout, L., Kennedy, D. and Kluzek, E., 2019.
! The Community Land Model version 5: Description of new features, benchmarking,
Expand Down
7 changes: 4 additions & 3 deletions main/CoLM.F90
Original file line number Diff line number Diff line change
Expand Up @@ -435,7 +435,7 @@ PROGRAM CoLM
#endif


! Call colm driver
! Call CoLM driver
! ----------------------------------------------------------------------
IF (p_is_worker) THEN
CALL CoLMDRIVER (idate,deltim,dolai,doalb,dosst,oroflag)
Expand All @@ -460,7 +460,7 @@ PROGRAM CoLM

CALL CheckEquilibrium (idate, deltim, itstamp, dir_hist, casename)

! DO land USE and land cover change simulation
! DO land use and land cover change simulation
! ----------------------------------------------------------------------
#ifdef LULCC
IF ( isendofyear(idate, deltim) ) THEN
Expand Down Expand Up @@ -541,9 +541,11 @@ PROGRAM CoLM
ENDIF
#endif
ENDIF

#ifdef RangeCheck
CALL check_TimeVariables ()
#endif

#ifdef USEMPI
CALL mpi_barrier (p_comm_glb, p_err)
#endif
Expand All @@ -554,7 +556,6 @@ PROGRAM CoLM
ENDIF
#endif


IF (p_is_master) THEN
CALL system_clock (end_time, count_rate = c_per_sec)
time_used = (end_time - start_time) / c_per_sec
Expand Down
72 changes: 35 additions & 37 deletions main/CoLMDRIVER.F90
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ SUBROUTINE CoLMDRIVER (idate,deltim,dolai,doalb,dosst,oro)
USE MOD_Forcing, only: forcmask_pch
USE omp_lib
#ifdef CaMa_Flood
! get flood variables: inundation depth[mm], inundation fraction [0-1],
! inundation evaporation [mm/s], inundation re-infiltration[mm/s]
USE MOD_CaMa_Vars, only : flddepth_cama,fldfrc_cama,fevpg_fld,finfg_fld
! get flood variables: inundation depth[mm], inundation fraction [0-1],
! inundation evaporation [mm/s], inundation re-infiltration[mm/s]
USE MOD_CaMa_Vars, only: flddepth_cama,fldfrc_cama,fevpg_fld,finfg_fld
#endif

IMPLICIT NONE
Expand Down Expand Up @@ -79,7 +79,7 @@ SUBROUTINE CoLMDRIVER (idate,deltim,dolai,doalb,dosst,oro)
DO k = 1, steps_in_one_deltim
! ***** Call CoLM main program *****
!
CALL CoLMMAIN (i,idate, coszen(i), deltim_phy, &
CALL CoLMMAIN ( i,idate, coszen(i), deltim_phy, &
patchlonr(i), patchlatr(i), patchclass(i), patchtype(i), &
doalb, dolai, dosst, oro(i), &

Expand All @@ -98,18 +98,17 @@ SUBROUTINE CoLMDRIVER (idate,deltim,dolai,doalb,dosst,oro)
BVIC(i), &
#if(defined CaMa_Flood)
! flood variables [mm, m2/m2, mm/s, mm/s]
flddepth_cama(i),fldfrc_cama(i),fevpg_fld(i), finfg_fld(i), &
flddepth_cama(i),fldfrc_cama(i), fevpg_fld(i), finfg_fld(i), &
#endif

! VEGETATION INFORMATION
htop(i), hbot(i), sqrtdi(m), &
effcon(m), vmax25(m), &
kmax_sun(m), kmax_sha(m), kmax_xyl(m), kmax_root(m), &
psi50_sun(m), psi50_sha(m), psi50_xyl(m), psi50_root(m), &
ck(m), &
slti(m), hlti(m), &
shti(m), hhti(m), trda(m), trdm(m), &
trop(m), g1(m), g0(m),gradm(m), binter(m), &
ck(m), slti(m), hlti(m), shti(m), &
hhti(m), trda(m), trdm(m), trop(m), &
g1(m), g0(m), gradm(m), binter(m), &
extkn(m), chil(m), rho(1:,1:,m), tau(1:,1:,m), &

! ATMOSPHERIC FORCING
Expand All @@ -136,7 +135,7 @@ SUBROUTINE CoLMDRIVER (idate,deltim,dolai,doalb,dosst,oro)
thermk(i), extkb(i), extkd(i), vegwp(1:,i), &
gs0sun(i), gs0sha(i), &
! Ozone Stress Variables
lai_old(i), o3uptakesun(i), o3uptakesha(i) ,forc_ozone(i), &
lai_old(i), o3uptakesun(i), o3uptakesha(i), forc_ozone(i), &
! End ozone stress variables
! WUE stomata model parameter
lambda(m), &
Expand All @@ -150,32 +149,31 @@ SUBROUTINE CoLMDRIVER (idate,deltim,dolai,doalb,dosst,oro)
mss_dst1(:,i), mss_dst2(:,i), mss_dst3(:,i), mss_dst4(:,i), &

! additional diagnostic variables for output
laisun(i), laisha(i), rootr(1:,i),rootflux(1:,i),rss(i),&
laisun(i), laisha(i), rootr(1:,i), rootflux(1:,i), &
rstfacsun_out(i),rstfacsha_out(i),gssun_out(i), gssha_out(i), &
assimsun_out(i), etrsun_out(i), assimsha_out(i), etrsha_out(i), &
h2osoi(1:,i), wat(i), &
h2osoi(1:,i), wat(i), rss(i), &

! FLUXES
taux(i), tauy(i), fsena(i), fevpa(i), &
lfevpa(i), fsenl(i), fevpl(i), etr(i), &
fseng(i), fevpg(i), olrg(i), fgrnd(i), &
trad(i), tref(i), qref(i), &
rsur(i), rsur_se(i), rsur_ie(i), rnof(i), &
qintr(i), qinfl(i), qdrip(i), &
rst(i), assim(i), respc(i), sabvsun(i), &
sabvsha(i), sabg(i), sr(i), solvd(i), &
solvi(i), solnd(i), solni(i), srvd(i), &
srvi(i), srnd(i), srni(i), solvdln(i), &
solviln(i), solndln(i), solniln(i), srvdln(i), &
srviln(i), srndln(i), srniln(i), qcharge(i), &
xerr(i), zerr(i), &
trad(i), tref(i), qref(i), rsur(i), &
rsur_se(i), rsur_ie(i), rnof(i), qintr(i), &
qinfl(i), qdrip(i), rst(i), assim(i), &
respc(i), sabvsun(i), sabvsha(i), sabg(i), &
sr(i), solvd(i), solvi(i), solnd(i), &
solni(i), srvd(i), srvi(i), srnd(i), &
srni(i), solvdln(i), solviln(i), solndln(i), &
solniln(i), srvdln(i), srviln(i), srndln(i), &
srniln(i), qcharge(i), xerr(i), zerr(i), &

! TUNABLE modle constants
zlnd, zsno, csoilc, dewmx, &
! 'wtfact' is updated to gridded 'fsatmax' data.
capr, cnfac, ssi, &
wimp, pondmx, smpmax, smpmin, &
trsmx0, tcrit, &
capr, cnfac, ssi, wimp, &
pondmx, smpmax, smpmin, trsmx0, &
tcrit, &

! additional variables required by coupling with WRF model
emis(i), z0m(i), zol(i), rib(i), &
Expand All @@ -189,7 +187,7 @@ SUBROUTINE CoLMDRIVER (idate,deltim,dolai,doalb,dosst,oro)
#if(defined BGC)
IF(patchtype(i) .eq. 0)THEN
!
! ***** Call CoLM BGC model *****
! ***** Call CoLM BGC model *****
!
CALL bgc_driver (i,idate(1:3),deltim, patchlatr(i)*180/PI,patchlonr(i)*180/PI)
ENDIF
Expand All @@ -201,8 +199,7 @@ SUBROUTINE CoLMDRIVER (idate,deltim,dolai,doalb,dosst,oro)
IF (DEF_URBAN_RUN .and. m.eq.URBAN) THEN

u = patch2urban(i)
!print *, "patch:", i, "urban:", u !fortest only

!
! ***** Call CoLM urban model *****
!
CALL CoLMMAIN_Urban ( &
Expand All @@ -215,8 +212,8 @@ SUBROUTINE CoLMDRIVER (idate,deltim,dolai,doalb,dosst,oro)
fgper(u) ,em_roof(u) ,em_wall(u) ,em_gimp(u) ,&
em_gper(u) ,cv_roof(:,u) ,cv_wall(:,u) ,cv_gimp(:,u) ,&
tk_roof(:,u) ,tk_wall(:,u) ,tk_gimp(:,u) ,z_roof(:,u) ,&
z_wall(:,u) ,dz_roof(:,u) ,dz_wall(:,u) ,&
lakedepth(i) ,dz_lake(1:,i) ,topostd(i) ,BVIC(i) ,&
z_wall(:,u) ,dz_roof(:,u) ,dz_wall(:,u) ,lakedepth(i) ,&
dz_lake(1:,i) ,topostd(i) ,BVIC(i) ,&

! LUCY INPUT PARAMETERS
fix_holiday(:,u),week_holiday(:,u),hum_prof(:,u) ,pop_den(u) ,&
Expand All @@ -228,7 +225,7 @@ SUBROUTINE CoLMDRIVER (idate,deltim,dolai,doalb,dosst,oro)
bsw(1:,i) ,theta_r(1:,i) ,fsatmax(i) ,fsatdcf(i) ,&
#ifdef vanGenuchten_Mualem_SOIL_MODEL
alpha_vgm(1:,i) ,n_vgm(1:,i) ,L_vgm(1:,i) ,&
sc_vgm (1:,i) ,fc_vgm (1:,i) ,&
sc_vgm(1:,i) ,fc_vgm(1:,i) ,&
#endif
hksati(1:,i) ,csol(1:,i) ,k_solids(1:,i), dksatu(1:,i) ,&
dksatf(1:,i) ,dkdry(1:,i) ,BA_alpha(1:,i) ,BA_beta(1:,i) ,&
Expand All @@ -238,8 +235,9 @@ SUBROUTINE CoLMDRIVER (idate,deltim,dolai,doalb,dosst,oro)
htop(i) ,hbot(i) ,sqrtdi(m) ,chil(m) ,&
effcon(m) ,vmax25(m) ,slti(m) ,hlti(m) ,&
shti(m) ,hhti(m) ,trda(m) ,trdm(m) ,&
trop(m) ,g1(m) ,g0(m),gradm(m) ,binter(m) ,&
extkn(m) ,rho(1:,1:,m) ,tau(1:,1:,m) ,rootfr(1:,m) ,&
trop(m) ,g1(m) ,g0(m) ,gradm(m) ,&
binter(m) ,extkn(m) ,rho(1:,1:,m) ,tau(1:,1:,m) ,&
rootfr(1:,m) ,&
! WUE model parameter
lambda(m) ,&
! END WUE model parameter
Expand Down Expand Up @@ -290,7 +288,7 @@ SUBROUTINE CoLMDRIVER (idate,deltim,dolai,doalb,dosst,oro)
t_lake(1:,i) ,lake_icefrac(1:,i), savedtke1(i) ,&

! SNICAR snow model related
snw_rds(:,i) ,ssno_lyr(:,:,:,i),&
snw_rds(:,i) ,ssno_lyr(:,:,:,i) ,&
mss_bcpho(:,i) ,mss_bcphi(:,i) ,mss_ocpho(:,i) ,mss_ocphi(:,i) ,&
mss_dst1(:,i) ,mss_dst2(:,i) ,mss_dst3(:,i) ,mss_dst4(:,i) ,&

Expand Down Expand Up @@ -323,9 +321,9 @@ SUBROUTINE CoLMDRIVER (idate,deltim,dolai,doalb,dosst,oro)
! TUNABLE model constants
zlnd ,zsno ,csoilc ,dewmx ,&
! 'wtfact' is updated to gridded 'fsatmax' data.
capr ,cnfac ,ssi ,&
wimp ,pondmx ,smpmax ,smpmin ,&
trsmx0 ,tcrit ,&
capr ,cnfac ,ssi ,wimp ,&
pondmx ,smpmax ,smpmin ,trsmx0 ,&
tcrit ,&

! additional variables required by coupling with WRF model
emis(i) ,z0m(i) ,zol(i) ,rib(i) ,&
Expand Down
Loading

0 comments on commit 0f3a6fc

Please sign in to comment.