Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Continued code format adjustment. #388

Merged
merged 8 commits into from
Feb 26, 2025
Merged
16 changes: 8 additions & 8 deletions main/CoLM.F90
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@

PROGRAM CoLM
!-----------------------------------------------------------------------------
! Description:
! This is the main program for the Common Land Model (CoLM)
! Description:
! This is the main program for the Common Land Model (CoLM)
!
! Copyright © Yongjiu Dai Land Modeling Group at the School of Atmospheric Sciences
! of the Sun Yat-sen University, Guangdong, CHINA.
! All rights reserved.
! Copyright © Yongjiu Dai Land Modeling Group at the School of Atmospheric Sciences
! of the Sun Yat-sen University, Guangdong, CHINA.
! All rights reserved.
!
! Initial : Yongjiu Dai, 1998-2014
! Revised : Hua Yuan, Shupeng Zhang, Nan Wei, Xingjie Lu, Zhongwang Wei, Yongjiu Dai
! 2014-2024
! Initial : Yongjiu Dai, 1998-2014
! Revised : Hua Yuan, Shupeng Zhang, Nan Wei, Xingjie Lu, Zhongwang Wei, Yongjiu Dai
! 2014-2024
!-----------------------------------------------------------------------------

USE MOD_Precision
Expand Down
8 changes: 4 additions & 4 deletions main/CoLMDRIVER.F90
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ SUBROUTINE CoLMDRIVER (idate,deltim,dolai,doalb,dosst,oro)

!=======================================================================
!
! CoLM MODEL DRIVER
! CoLM MODEL DRIVER
!
! Initial : Yongjiu Dai, 1999-2014
! Revised : Hua Yuan, Shupeng Zhang, Nan Wei, Xingjie Lu, Zhongwang Wei, Yongjiu Dai
! 2014-2024
! Initial : Yongjiu Dai, 1999-2014
! Revised : Hua Yuan, Shupeng Zhang, Nan Wei, Xingjie Lu, Zhongwang Wei, Yongjiu Dai
! 2014-2024
!
!=======================================================================

Expand Down
57 changes: 28 additions & 29 deletions main/CoLMMAIN.F90
Original file line number Diff line number Diff line change
Expand Up @@ -105,37 +105,37 @@ SUBROUTINE CoLMMAIN ( &

!=======================================================================
!
! Main subroutine, advance time information
! Main subroutine, advance time information
!
! Initial : Yongjiu Dai, 1999-2014
! Revised : Hua Yuan, Shupeng Zhang, Nan Wei, Xingjie Lu, Zhongwang Wei, Yongjiu Dai
! 2014-2024
! Initial : Yongjiu Dai, 1999-2014
! Revised : Hua Yuan, Shupeng Zhang, Nan Wei, Xingjie Lu, Zhongwang Wei, Yongjiu Dai
! 2014-2024
!
! FLOW DIAGRAM FOR CoLMMAIN
! FLOW DIAGRAM FOR CoLMMAIN
!
! CoLMMAIN ===>netsolar |> all surface
! rain_snow_temp !> all surface
! CoLMMAIN ===>netsolar |> all surface
! rain_snow_temp !> all surface
!
! LEAF_interception |]
! newsnow |] patchtype = 0 (soil ground)
! THERMAL |] = 1 (urban & built-up)
! WATER |] = 2 (wetland)
! snowcompaction |] = 3 (land ice)
! snowlayerscombine |] = 4 (lake)
! snowlayersdivide |]
! snowage |]
! LEAF_interception |]
! newsnow |] patchtype = 0 (soil ground)
! THERMAL |] = 1 (urban & built-up)
! WATER |] = 2 (wetland)
! snowcompaction |] = 3 (land ice)
! snowlayerscombine |] = 4 (lake)
! snowlayersdivide |]
! snowage |]
!
! newsnow_lake |]
! laketem |] lake scheme
! snowwater_lake |]
! newsnow_lake |]
! laketem |] lake scheme
! snowwater_lake |]
!
! SOCEAN |> ocean and sea ice
! SOCEAN |> ocean and sea ice
!
! orb_coszen |> all surface
! EcoModel (LAI_empirical) |> land
! snowfraction |> land
! albland |> land
! albocean |> ocean & sea ice
! orb_coszen |> all surface
! EcoModel (LAI_empirical) |> land
! snowfraction |> land
! albland |> land
! albocean |> ocean & sea ice
!
!=======================================================================

Expand Down Expand Up @@ -191,8 +191,7 @@ SUBROUTINE CoLMMAIN ( &
patchclass ,&! land patch class of USGS classification or others
patchtype ! land patch type (0=soil, 1=urban and built-up,
! 2=wetland, 3=land ice, 4=land water bodies, 99 = ocean)
! Parameters
! ----------------------

real(r8), intent(in) :: lakedepth ! lake depth (m)
real(r8), intent(inout) :: dz_lake(nl_lake) ! lake layer thickness (m)

Expand Down Expand Up @@ -283,7 +282,7 @@ SUBROUTINE CoLMMAIN ( &
tcrit ! critical temp. to determine rain or snow

! Forcing
! ----------------------
!-----------------------------------------------------------------------
real(r8), intent(in) :: &
forc_pco2m ,&! partial pressure of CO2 at observational height [pa]
forc_po2m ,&! partial pressure of O2 at observational height [pa]
Expand Down Expand Up @@ -314,7 +313,7 @@ SUBROUTINE CoLMMAIN ( &
real(r8), intent(out) :: qinfl_fld !effective re-infiltration from inundation [mm/s]
#endif
! Variables required for restart run
! ----------------------------------------------------------------------
!-----------------------------------------------------------------------
integer, intent(in) :: &
idate(3) ! next time-step /year/julian day/second in a day/

Expand Down Expand Up @@ -406,7 +405,7 @@ SUBROUTINE CoLMMAIN ( &
assimsha_out,&
etrsha_out
! Fluxes
! ----------------------------------------------------------------------
!-----------------------------------------------------------------------
real(r8), intent(out) :: &
taux ,&! wind stress: E-W [kg/m/s**2]
tauy ,&! wind stress: N-S [kg/m/s**2]
Expand Down
33 changes: 17 additions & 16 deletions main/MOD_Aerosol.F90
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@ MODULE MOD_Aerosol
IMPLICIT NONE
SAVE

! !PUBLIC MEMBER FUNCTIONS:
! PUBLIC MEMBER FUNCTIONS:
PUBLIC :: AerosolMasses
PUBLIC :: AerosolFluxes
PUBLIC :: AerosolDepInit
PUBLIC :: AerosolDepReadin
!
! !PUBLIC DATA MEMBERS:

! PUBLIC DATA MEMBERS:
!-----------------------------------------------------------------------

logical, parameter :: use_extrasnowlayers = .false.
Expand All @@ -37,7 +37,6 @@ MODULE MOD_Aerosol

CONTAINS

!-----------------------------------------------------------------------
SUBROUTINE AerosolMasses( dtime ,snl ,do_capsnow ,&
h2osno_ice ,h2osno_liq ,qflx_snwcp_ice ,snw_rds ,&

Expand All @@ -47,13 +46,14 @@ SUBROUTINE AerosolMasses( dtime ,snl ,do_capsnow ,&
mss_cnc_bcphi ,mss_cnc_bcpho ,mss_cnc_ocphi ,mss_cnc_ocpho ,&
mss_cnc_dst1 ,mss_cnc_dst2 ,mss_cnc_dst3 ,mss_cnc_dst4 )

!
! !DESCRIPTION:
! Calculate column-integrated aerosol masses, and
! mass concentrations for radiative calculations and output
! (based on new snow level state, after SnowFilter is rebuilt.
! NEEDS TO BE AFTER SnowFiler is rebuilt in Hydrology2, otherwise there
! can be zero snow layers but an active column in filter)
!-----------------------------------------------------------------------
! !DESCRIPTION:
! Calculate column-integrated aerosol masses, and
! mass concentrations for radiative calculations and output
! (based on new snow level state, after SnowFilter is rebuilt.
! NEEDS TO BE AFTER SnowFiler is rebuilt in Hydrology2, otherwise there
! can be zero snow layers but an active column in filter)
!-----------------------------------------------------------------------

IMPLICIT NONE

Expand Down Expand Up @@ -165,14 +165,15 @@ END SUBROUTINE AerosolMasses



!-----------------------------------------------------------------------
SUBROUTINE AerosolFluxes( dtime, snl, forc_aer, &
mss_bcphi ,mss_bcpho ,mss_ocphi ,mss_ocpho ,&
mss_dst1 ,mss_dst2 ,mss_dst3 ,mss_dst4 )
!
! !DESCRIPTION:
! Compute aerosol fluxes through snowpack and aerosol deposition fluxes into top layer
!
!-----------------------------------------------------------------------
! !DESCRIPTION:
! Compute aerosol fluxes through snowpack and aerosol deposition fluxes
! into top layer
!
!-----------------------------------------------------------------------
IMPLICIT NONE
!
!-----------------------------------------------------------------------
Expand Down
58 changes: 29 additions & 29 deletions main/MOD_Albedo.F90
Original file line number Diff line number Diff line change
Expand Up @@ -37,43 +37,43 @@ SUBROUTINE albland (ipatch,patchtype,deltim,&
alb,ssun,ssha,ssoi,ssno,ssno_lyr,thermk,extkb,extkd)

!=======================================================================
! Calculates fragmented albedos (direct and diffuse) in
! wavelength regions split at 0.7um.
! Calculates fragmented albedos (direct and diffuse) in
! wavelength regions split at 0.7um.
!
! (1) soil albedos: as in BATS formulations, which are the function of
! soil color and moisture in the surface soil layer
! (2) snow albedos: as in BATS formulations, which are inferred from
! the calculations of Wiscombe and Warren (1980) and the snow model
! and data of Anderson(1976), and the function of snow age, grain
! size, solar zenith angle, pollution, the amount of the fresh snow
! (3) canopy albedo: two-stream approximation model
! (4) glacier albedos: as in BATS, which are set to constants (0.8 for
! visible beam, 0.55 for near-infrared)
! (5) lake and wetland albedos: as in BATS, which depend on cosine solar
! zenith angle, based on data in Henderson-Sellers (1986). The
! frozen lake and wetland albedos are set to constants (0.6 for
! visible beam, 0.4 for near-infrared)
! (6) over the snow covered tile, the surface albedo is estimated by a
! linear combination of albedos for snow, canopy and bare soil (or
! lake, wetland, glacier).
! (1) soil albedos: as in BATS formulations, which are the function of
! soil color and moisture in the surface soil layer
! (2) snow albedos: as in BATS formulations, which are inferred from
! the calculations of Wiscombe and Warren (1980) and the snow model
! and data of Anderson(1976), and the function of snow age, grain
! size, solar zenith angle, pollution, the amount of the fresh snow
! (3) canopy albedo: two-stream approximation model
! (4) glacier albedos: as in BATS, which are set to constants (0.8 for
! visible beam, 0.55 for near-infrared)
! (5) lake and wetland albedos: as in BATS, which depend on cosine solar
! zenith angle, based on data in Henderson-Sellers (1986). The
! frozen lake and wetland albedos are set to constants (0.6 for
! visible beam, 0.4 for near-infrared)
! (6) over the snow covered tile, the surface albedo is estimated by a
! linear combination of albedos for snow, canopy and bare soil (or
! lake, wetland, glacier).
!
! Original author: Yongjiu Dai, 09/15/1999; 08/30/2002, 03/2014
! Original author: Yongjiu Dai, 09/15/1999; 08/30/2002, 03/2014
!
! !REVISIONS:
! 12/2019, Hua Yuan: added a wrap FUNCTION for PFT calculation, details
! see twostream_wrap() added a wrap FUNCTION for PC (3D)
! calculation, details see ThreeDCanopy_wrap()
! 12/2019, Hua Yuan: added a wrap FUNCTION for PFT calculation, details
! see twostream_wrap() added a wrap FUNCTION for PC (3D)
! calculation, details see ThreeDCanopy_wrap()
!
! 03/2020, Hua Yuan: added an improved two-stream model, details see
! twostream_mod()
! 03/2020, Hua Yuan: added an improved two-stream model, details see
! twostream_mod()
!
! 08/2020, Hua Yuan: account for stem optical property effects in
! twostream model
! 08/2020, Hua Yuan: account for stem optical property effects in
! twostream model
!
! 01/2023, Hua Yuan: CALL SNICAR model to calculate snow
! albedo&absorption, added SNICAR related variables
! 01/2023, Hua Yuan: CALL SNICAR model to calculate snow
! albedo&absorption, added SNICAR related variables
!
! 04/2024, Hua Yuan: add option to account for vegetation snow process
! 04/2024, Hua Yuan: add option to account for vegetation snow process
!
!=======================================================================

Expand Down
25 changes: 12 additions & 13 deletions main/MOD_CheckEquilibrium.F90
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@

MODULE MOD_CheckEquilibrium

!----------------------------------------------------------------------------
! DESCRIPTION:
!
! Check equilibrium state.
!
! Created by Shupeng Zhang, 10/2024
!----------------------------------------------------------------------------
!----------------------------------------------------------------------------
! !DESCRIPTION:
!
! Check equilibrium state.
!
! Created by Shupeng Zhang, 10/2024
!----------------------------------------------------------------------------

USE MOD_SPMD_Task
USE MOD_Grid
Expand All @@ -33,14 +33,13 @@ MODULE MOD_CheckEquilibrium
integer :: check_data_id = 0
#endif

! ----- Subroutines -----
PUBLIC :: CheckEqb_init
PUBLIC :: CheckEquilibrium
PUBLIC :: CheckEqb_final

CONTAINS

!---------------------------------------
!-----------------------------------------------------------------------
SUBROUTINE CheckEqb_init ()

USE MOD_Forcing, only: gforc
Expand Down Expand Up @@ -72,7 +71,7 @@ SUBROUTINE CheckEqb_init ()

END SUBROUTINE CheckEqb_init

!--------------------------------------
!-----------------------------------------------------------------------
SUBROUTINE CheckEqb_final ()

IMPLICIT NONE
Expand All @@ -85,7 +84,7 @@ SUBROUTINE CheckEqb_final ()

END SUBROUTINE CheckEqb_final

!---------------------------------------
!-----------------------------------------------------------------------
SUBROUTINE CheckEquilibrium (idate, deltim, itstamp, dir_out, casename)

USE MOD_Precision
Expand Down Expand Up @@ -242,7 +241,7 @@ SUBROUTINE CheckEquilibrium (idate, deltim, itstamp, dir_out, casename)

END SUBROUTINE CheckEquilibrium

!---------------------------------------
!-----------------------------------------------------------------------
#ifndef SinglePoint
SUBROUTINE map_and_write_check_var ( &
vector, filename, varname, itime_in_file, sumarea, filter, &
Expand Down Expand Up @@ -401,7 +400,7 @@ SUBROUTINE map_and_write_check_var ( &
END SUBROUTINE map_and_write_check_var
#endif

!------
!-----------------------------------------------------------------------
SUBROUTINE add_spv (var, s, dt)

USE MOD_Precision
Expand Down
5 changes: 3 additions & 2 deletions main/MOD_Const_LC.F90
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ MODULE MOD_Const_LC
! 08/2019, Hua Yuan: added constants values for IGBP land cover types
! 05/2023, Xingjie Lu: added Plant Hydraulics Parameters
!
!-----------------------------------------------------------------------
! !USES:
USE MOD_Precision
USE MOD_Vars_Global
Expand All @@ -24,7 +25,7 @@ MODULE MOD_Const_LC
#ifdef LULC_USGS

! GLCC USGS Land Use/Land Cover System Legend
!---------------------------
!-----------------------------------------------------------------------
! 0 Ocean
! 1 Urban and Built-Up Land
! 2 Dryland Cropland and Pasture
Expand Down Expand Up @@ -328,7 +329,7 @@ MODULE MOD_Const_LC
#else

! MODIS IGBP Land Use/Land Cover System Legend
!---------------------------
!-----------------------------------------------------------------------
! 0 Ocean
! 1 Evergreen Needleleaf Forests
! 2 Evergreen Broadleaf Forests
Expand Down
3 changes: 2 additions & 1 deletion main/MOD_Const_PFT.F90
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ MODULE MOD_Const_PFT
! !REVISIONS:
! 10/2021, Xingjie Lu: added for crop PFTs
!
!-----------------------------------------------------------------------
! !USES:
USE MOD_Precision
USE MOD_Vars_Global
Expand All @@ -22,7 +23,7 @@ MODULE MOD_Const_PFT
SAVE

! Plant Functional Type classification
!---------------------------
!-----------------------------------------------------------------------
! 0 not vegetated
! 1 needleleaf evergreen temperate tree
! 2 needleleaf evergreen boreal tree
Expand Down
Loading