CABLE-LSM / CABLE-Trac-archive

Archive CABLE Trac contents as issues
Other
0 stars 0 forks source link

Mark: #191

Closed penguian closed 6 years ago

penguian commented 6 years ago

keyword_nogit resolution_fixed type_ACCESS-CM2 | by srb001@csiro.au


ci JULES-MOSRS: https://code.metoffice.gov.uk/svn/jules/main/branches/dev/Share/vn10.6_CABLE@10750

CABLE-TRAC: changests: -da37b8785a1e30bb765871d86dd9f8c26e6caf15 -7d10430f3f6f96eb93e8d7f496599d146041e5b8 -c16397db0a54ad18144e62fb3ebf53e4eec67557


Issue migrated from trac:191 at 2023-11-27 11:25:38 +1100

penguian commented 6 years ago

m.decker@unsw.edu.au commented


NOTE: The per file changes and rational is in progress.

CABLE: Tickets I've handled:

Ticket 188: Calls to saturated_fraction:

ssnow%wetfac was previsouly calculated in cable_canopy.F90 in the subroutine 

New options available change how to calculate soil evaporation: 1) or_evap=true: set ssnow%wetfac = 1.0, unless over lakes 2) gw_model=true: uses a nonlinear function (Decker 2015) to calculate ssnow%wetfac

3) gw_model=false and or_evap=false: use default linear function

1) and 2) calculate the soil evaporation separately for the saturated (ssnow%satfrac) and unsaturated (1-ssnow%satfrac) fractions of the tile. Previously the call to saturated_fraction for case 3) above causes uninitialized variables to be utilized. This has been fixed by setting all of the per layer soil properties the gw_model uses independent of any switches in offline and UM. However, since saturated_fraction does not do anything useful for case 3) the subroutine is only called for cases 1 and 2. For case 3 ssnow%satfrac=0.0.

Ticket #174 (new model improvement) For gw_hydro (gw_model=true) when cable_user%runtime_coupled=false, wbice is set as ssnow%wbice = 0.95 ssnow%wb
ssnow%wb = 0.95
soil%ssat_vec for isoilm .eq. 9

for coupled simulations this is not reset

Changes to specific files:

cable_soilsnow.F90 Many changes to allow increased hiding, moving parameters to where they belong, adding soil thermal fixes.

 the state variable ssnow%wbliq has been added.  it is the volumetric liquid water content (ssnow%wb - ssnow%wbice).
 Soilsnow assumes the density of liquid and ice in the soil are both 1000.0, however this isn't true.  If they are unequal ssnow%wbliq is needed to calculate the total mass dz*(wbliq*rho_liq + wbice*rho_ice)

 gw_hydro calls the snow routines, and the soil thermal flux routine from this module.  Previously I made all of the subroutines and paramters public and called them from soil_snow_gw in the cable_gw_hydro module.  I have simplified how soilsnow makes subroutines available to the gw_hydro module by:

1) Move GWstempv from cable_gw_hydro.F90 to cable_soilsnow.F90 GWstempv is the same subroutine as stempv, with the only difference in that GWstempv uses the soil parameters that can vary by layer. GWstempv is a seperate subroutine to ensure bitwise reproducability. Because the per layer soil parameters (css_vec,rhosoil_vec,etc.) are defined as r_2, while the default sinlge level parameters (css,rhosoil, etc) are single precision, replacing css with css_vec in stempv breaks bitwise compatibility. Therefore GWstempv was created. The CABLE comittee need to decide if stempv should keep using single level r_1 parameters or if they can be replaced with per level r_2 parameters. If not, GWstempv should remain.

  Note: GWsoilfreeze and remove_transGW have the same issue as GWstempv.  They are subroutines that exist only to keep bitwise compatibility with trunk.
        remove_transGW is the same as remove_trans but uses the r_2 per layer parameters.
        GWsoilfreeze also uses the r_2 parameters but additionally contains a dynamic maximum frozen water content calculation, allowing varying amounts of liquid water to remain in the soil below TFRZ, and melting ice before the soil reaches TFRZ based on the maximum amount of liquid that is calculated.  The only change needed to make GWsoil_freeze the exact same as soilfreeze (aside from using r_2 parameters) would be to  define max_ice_frac as an r_1 variable and to add the check:
       if (.not.cable_user%gw_model) then
            max_ice_frac(:,:) = frozen_limit
            tgg_tmp(:,:) = TFRZ
       else
         !existing calcs for tgg_tmp and max_ice_frac
      end if

2) Moved paramters from soilsnow to cable_common.F90 The parameters defined in soilsnow: snow_ccnsw,snmin,& max_ssdn,max_sconds,frozen_limit,& max_glacier_snowd are not physical constants and are hard wired (cannot be changed with a namelist file). Instead of making these public to be called from gw_hydro I moved them to cable_common. This will allow these paramters to be changed via namelist in the future (if added to cable_user) and shared with gw_hydro.

3) use constants from physical_constants.

    cgsnow,cswat,csice have3 been moved to the cable_constants.F90 file in the physical_constants module.
    Additionally, the constants: cs_rho_ice,cs_rho_wat have been added.  These are simply the heat capacity per kg (density * capacity) rather than capacity per m3.  Because csice and cswat are always used as csice*density and cswat*density it simplifies the code to have the constant be the product of capacity and density.

4) created snow_processes_soil_thermal, a public subroutine that calls the private snow/soil subroutines This subroutine is called from gw_hydro, and allows all of the other subroutines previsouly called to be private. The main benefit is that the pointer to the constants in cable_data (C) is only set once then all of the subroutines are called. The subroutine calls: snowcheck (dels, ssnow, soil, met ) snowdensity (dels, ssnow, soil) snow_accum (dels, canopy, met, ssnow, soil ) snow_melting (dels, snowmlt, ssnow, soil ) snowl_adjust(dels, ssnow, canopy ) GWstempv(dels, canopy, ssnow, soil) snow_melting (dels, snowmlt, ssnow, soil )

cable_psm.F90 Moved parameters that will never change to cable_constants.F90, and then use this module. Added a new subroutine update_or_soil_resis(ssnow,canopy,veg,dq,dqu) This subroutine is necessary for updating the or resistances when the moisture flux is negative (downward). WHen this occurs the only resistance is the downward diffusion across the viscous sublayer, the other components are not relevant. It is called after the direction of the flux is known from cable_canopy

cable_canopy.F90 The calculation of ssnow%wetfac was changed in the gw_hydro module, so that wetfac is used with the or_evap parametrization over lakes/ice. To reflect this change ssnow%wetfac was added to fix_eqn when or_evap=true

  IF (cable_user%or_evap) THEN
     fix_eqn(:) = rt0(:)*(real(ssnow%satfrac(:))/(rt0(:)+real(ssnow%rtevap_sat(:))) + &
                     (1-real(ssnow%satfrac(:)))/(rt0(:)+real(ssnow%rtevap_unsat(:))))
     !lakes/ice rtevap=0 and wetfac is .ne. 1
     fix_eqn(:) = ssnow%wetfac(:) * fix_eqn(:)*ssnow%cls(:)            !INH correction  

     fix_eqn2(:) = rt0(:) / (rt0(:) + real(ssnow%rt_qh_sublayer) )

  ELSE  !with INH corrections for litter and cls

     fix_eqn(:) = ssnow%cls(:)*rt0(:)/(rt0(:)+relitt(:))
     WHERE (ssnow%potev>0.) fix_eqn(:)=fix_eqn(:)*ssnow%wetfac(:)
     fix_eqn2(:) = rt0(:)/(rt0(:)+rhlitt(:))

  END IF fix_eqn(:) = ssnow%wetfac(:) * fix_eqn(:)*ssnow%cls(:)  

cable_gw_hydro.F90

GWstempv was moved to soilsnow (GWsoil_freeze and remove_transGW could also be moved).

A single subroutine from cable_soilsnow (snow_processes_soil_thermal) replaces the calls to all the snow subroutines.

The cable_data module is no longer used to get the needed physical constants.  Instead cable_constants.F90 is used to import the values.  The benefit is that when SLI si made to call the gw_hydro subroutines a data pointer will not need to be set/worried about.

The calc_srf_wet_fraction subroutine has been modified in the following ways: only call saturated_fraction when or_evap or gw_model is true, otherwise set ssnow%satfrac=0.0 use the default ssnow%wetfac when or_evap is true over lakes.

cable_constants.F90

A new module gwhydro_constants has been added. This contains constants that were set in gw_hydro module. Added to the physical_constants module the values needed by gw_hydro and soilsnow.

UM/init/cable_um_init_subrs.F90 initialise_soil: The default soilsnow module and gw_hydro assume the parameters are in different units. The units are made to be correct with IF (cable_user%gw_model) THEN sucs_sign_factor = 1.0 hyds_unit_factor = 1.0 sucs_min_magnitude = 106.0 ELSE sucs_sign_factor = 1.0 hyds_unit_factor = 1.0/1000.0 sucs_min_magnitude = 106.0/1000.0 END IF

This just provides a simple way to ensure the units are correct.

The limits on the gw_model data that is read into soil%GWdz,soil%slope,soil%slope_std are still hard coded but use the previsouly tested values. Also, the values for lake tiles are set to generic values as lakes do not have slopes.

The biggest change is the additional code to initialize the variables needed to fix the bugs in the soil thermal calculations. The alternate calculation depends on the soil texture fractions (fraction of clay: soil%clay_vec or soil%clay). Therefore additional code checks that the sand,clay, and silt fractions are reasonable and if not sets them to reasonable values. The variable soil%rhosoil (soil%rhosoil_vec) are kept as the default values unless cable_user%soil_thermal_fix is true, then they are set as the density of the soil grains (constant 2700.0), and the bulk density is found using rhosoil(1-ssat). The dry soil thermal conducitivy (cnsd cnsd_vec) is calculated using the bulk density, and the three parameters for calcualting the actual conductivity in soilsnow are set.

Initialize soilsnow: To allow differing ice and liquid densities in soil the method for getting ssnow%wbice and ssnow%wb from the total mass (SMCL_TILE) and the ice fraction (STHF_TILE) has been changed.

The ice volume is found first by STHF_TILESMVCST to give ssnow%wbice. The mass of the ice is found using wqbicedz*rho_ice. Then the mass of the liquid is found ass total_mass - ice_mass. The liquid mass is used to find the liquid volume (ssnow%wbliq), and finally ssnow%wb is wbliq+wbice.

This method works when the liq and ice densities are different or the same.

cable_um_implicit_unpack.F90 The gw_hydro module does not force the density of soil ice to be equal to the density of soil water (density_ice,density_liq in cable_constants). Therefore the method for setting ssnow%wb and ssnow%wbice has changed to allowd the densities to differ. The total mass of soil moisture (SMCL_TILE) is found by using wbliq and rho_water and then adding wbice*rho_ice.

cable_um_tech.F90 The constant rho_ice was added in addition to rho_water.

I am not sure why rho_XXXX need to be included in the um variable given that they could be easily imported from cable_constants.

cable_cbm.F90 Because public subroutines are now defined in soilsnow and gw_hydro, only statements were added to the use statements to ensure unused subroutines are not imported.

cable_define_types.F90 (and others...) The names of the per layer soil parameters for sand,silt,clay,organic fraction have been changed to follow the same naming scheme as the other soil parameters (SingleLevelName_vec). Addtionally soil%{zse_vec was added, Ktherm_const_one,Ktherm_const_two,Ktherm_const_three, css_vec, cnsd_vec} were added.

penguian commented 6 years ago

m.decker@unsw.edu.au commented


cable_explicit_main.F90 Added the variables for gw_model=true aquifer_moist_cable, aquifer_thickness_cable, slope_avg_cable, slope_std_cable All are imported from the um module atm_fields_real_mod and passed to cable_explicit_driver.F90

cable_explicit_driver.F90 Added variables.

penguian commented 6 years ago

@jxs599@nci.org.au changed owner from bep599 to jxs599

penguian commented 6 years ago

@jxs599@nci.org.au changed component from MPI to model

penguian commented 6 years ago

@jxs599@nci.org.au changed milestone from ` to1. Closed`

penguian commented 6 years ago

@jxs599@nci.org.au changed owner from jxs599 to jxs599,mrd599

penguian commented 6 years ago

@jxs599@nci.org.au changed status from new to assigned

penguian commented 6 years ago

@jxs599@nci.org.au changed owner from jxs599,mrd599 to jxs599

penguian commented 6 years ago

@jxs599@nci.org.au edited the issue description

penguian commented 6 years ago

@jxs599@nci.org.au changed milestone from 1. Closed to 3. Implementation

penguian commented 6 years ago

@jxs599@nci.org.au changed owner from jxs599 to jxs599, mrd561

penguian commented 6 years ago

@jxs599@nci.org.au changed status from assigned to new

penguian commented 6 years ago

@jxs599@nci.org.au changed priority from major to blocker

penguian commented 6 years ago

@jxs599@nci.org.au changed status from new to closed

penguian commented 6 years ago

@jxs599@nci.org.au changed resolution from ` tofixed`

penguian commented 6 years ago

@jxs599@nci.org.au edited the issue description

penguian commented 6 years ago

@jxs599@nci.org.au changed milestone from 3. Implementation to 1. Closed

penguian commented 1 year ago

@ccc561@nci.org.au set keywords to nogit