From ef30806609599dbabf6284b5546cf45d575c4e67 Mon Sep 17 00:00:00 2001 From: "Srbinovsky, Jhan (O&A, Aspendale)" Date: Wed, 30 Oct 2024 15:58:50 +1100 Subject: [PATCH 1/2] exterminate cable_data --- .../ESM1.5/CABLEfilesFromESM1.5/cable_cbm.F90 | 12 +- .../CABLEfilesFromESM1.5/cable_data.F90 | 445 ------------------ .../cable_explicit_driver.F90 | 7 +- .../CABLEfilesFromESM1.5/cable_hyd_driver.F90 | 4 - .../cable_implicit_driver.F90 | 26 +- .../cable_um_init_subrs.F90 | 15 +- src/coupled/ESM1.5/casa_um_inout.F90 | 6 +- src/science/gw_hydro/cable_gw_hydro.F90 | 1 - 8 files changed, 20 insertions(+), 496 deletions(-) delete mode 100644 src/coupled/ESM1.5/CABLEfilesFromESM1.5/cable_data.F90 diff --git a/src/coupled/ESM1.5/CABLEfilesFromESM1.5/cable_cbm.F90 b/src/coupled/ESM1.5/CABLEfilesFromESM1.5/cable_cbm.F90 index 55b684d2f..24ea3a430 100644 --- a/src/coupled/ESM1.5/CABLEfilesFromESM1.5/cable_cbm.F90 +++ b/src/coupled/ESM1.5/CABLEfilesFromESM1.5/cable_cbm.F90 @@ -34,10 +34,8 @@ SUBROUTINE cbm( dels, air, bgc, canopy, met, & USE cable_def_types_mod USE cable_roughness_module USE cable_air_module -#ifndef NO_CASA_YET - USE casadimension, only : icycle ! used in casa_cnp -#endif - USE cable_data_module, ONLY : icbm_type, point2constants + USE casadimension, ONLY: icycle + USE cable_phys_constants_mod, ONLY: GRAV, CAPP !ptrs to local constants TYPE( icbm_type ) :: C @@ -69,15 +67,11 @@ SUBROUTINE cbm( dels, air, bgc, canopy, met, & LOGICAL :: jls_radiation= .FALSE. LOGICAL :: cbl_standalone = .FALSE. - - ! assign local ptrs to constants defined in cable_data_module - CALL point2constants(C) - cable_runtime%um_radiation = .FALSE. IF( cable_runtime%um_explicit ) THEN CALL ruff_resist( veg, rough, ssnow, canopy, veg%vlai, veg%hc, canopy%vlaiw ) - met%tk = met%tk + C%grav/C%capp*(rough%zref_tq + 0.9*rough%z0m) + met%tk = met%tk + GRAV/CAPP*(rough%zref_tq + 0.9*rough%z0m) ENDIF CALL define_air (met, air) diff --git a/src/coupled/ESM1.5/CABLEfilesFromESM1.5/cable_data.F90 b/src/coupled/ESM1.5/CABLEfilesFromESM1.5/cable_data.F90 deleted file mode 100644 index 9bd7162a4..000000000 --- a/src/coupled/ESM1.5/CABLEfilesFromESM1.5/cable_data.F90 +++ /dev/null @@ -1,445 +0,0 @@ -#define ESM15 YES -!============================================================================== -! This source code is part of the -! Australian Community Atmosphere Biosphere Land Exchange (CABLE) model. -! This work is licensed under the CABLE Academic User Licence Agreement -! (the "Licence"). -! You may not use this file except in compliance with the Licence. -! A copy of the Licence and registration form can be obtained from -! http://www.cawcr.gov.au/projects/access/cable -! You need to register and read the Licence agreement before use. -! Please contact cable_help@nf.nci.org.au for any questions on -! registration and the Licence. -! -! Unless required by applicable law or agreed to in writing, -! software distributed under the Licence is distributed on an "AS IS" BASIS, -! WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -! See the Licence for the specific language governing permissions and -! limitations under the Licence. -! ============================================================================== -! -! Purpose: Defines constants for CABLE -! -! Contact: Jhan.Srbinovsky@csiro.au -! -! History: Combines cable_*_constants from earlier versions -! Will include define_types in future version. -! -! -! ============================================================================== - -module cable_data_module - implicit none - - public - - ! definition of major types of constants - - TYPE physical_constants - real :: & - capp = 1004.64, & ! air spec. heat (J/kg/K) - hl = 2.5014e6, & ! air spec. heat (J/kg/K) - hlf = 0.334e6, & ! latent heat of fusion - !hl = 2.5104e6, & ! air spec. heat (J/kg/K) - !hlf = 0.335e6, & ! latent heat of fusion - dheat = 21.5E-6, & ! molecular diffusivity for heat - !grav = 9.80, & ! gravity acceleration (m/s2) - grav = 9.8086, & ! gravity acceleration (m/s2) - rgas = 8.3143, & ! universal gas const (J/mol/K) - rmair = 0.02897, & ! molecular wt: dry air (kg/mol) - rmh2o = 0.018016, & ! molecular wt: water (kg/mol) - sboltz = 5.67e-8, & ! Stefan-Boltz. constant (W/m2/K4) - tfrz = 273.16, & ! Temp (K) corresp. to 0 C - - ! Teten coefficients - tetena = 6.106, & ! ??? refs? - tetenb = 17.27, & - tetenc = 237.3, & - - ! Aerodynamic parameters, diffusivities, water density: - vonk = 0.40, & ! von Karman constant - a33 = 1.25, & ! inertial sublayer sw/us - csw = 0.50, & ! canopy sw decay (Weil theory) - ctl = 0.40, & ! Wagga wheat (RDD 1992, Challenges) - apol = 0.70, & ! Polhausen coeff: single-sided plate - prandt = 0.71, & ! Prandtl number: visc/diffh - schmid = 0.60, & ! Schmidt number: visc/diffw - diffwc = 1.60, & ! diffw/diffc = H2O/CO2 diffusivity - rhow = 1000.0, & ! liquid water density [kg/m3] - emleaf = 1.0, & ! leaf emissivity - emsoil = 1.0, & ! soil emissivity - crd = 0.3, & ! element drag coefficient - csd = 0.003, & ! substrate drag coefficient - - !jhan:hardwire for now. note beta2 = crd/csd - beta2 = 0.3/0.003, & ! ratio cr/cs - ccd = 15.0, & ! constant in d/h equation - ccw_c = 2.0, & ! ccw=(zw-d)/(h-d) - usuhm = 0.3, & ! (max of us/uh) - - ! Turbulence parameters: - zetmul = 0.4, & ! if niter=2, final zeta=zetmul*zetar(2) - ! NB> niter currently=4 see cable_define_types.F90 - zeta0 = 0.0, & ! initial value of za/L - zetneg = -15.0, & ! negative limit on za/L when niter>=3 - zetpos = 1.0, & ! positive limit on za/L when niter>=3 - zdlin = 1.0, & ! height frac of d below which TL linear -# ifdef ESM15 - umin = 0.01 -# else - umin = 0.1 !CM2 -# endif - - END TYPE physical_constants - - - - - type math_constants - real :: pi_c = 3.1415927 - !jhan:hardwire for now. note pi180= pi_c/180 - real :: pi180 = 3.1415927/ 180.0 ! radians / degree - end type math_constants - - type other_constants - !where 3 = no. radiation bands (nrb in define types) - real, DIMENSION(3) :: gauss_w=(/0.308,0.514,0.178/) ! Gaussian integ. weights - !--- jhan: can make these trigger of #defines/namelist -# ifdef ESM15 - real:: RAD_THRESH = 0.01 - real:: LAI_THRESH = 0.01 -# else - real:: RAD_THRESH = 0.001 - real:: LAI_THRESH = 0.001 -# endif - end type other_constants - - type photosynthetic_constants - integer:: maxiter=20 ! max # interations for leaf temperature - real :: a1c3 = 9.0 - real :: a1c4 = 4.0 - real :: alpha3 = 0.200 - real :: alpha4 = 0.05 - real :: conkc0 = 302.e-6 !mol mol^-1 - real :: conko0 = 256.e-3 !mol mol^-1 - real :: convx3 = 1.0E-2 - real :: convx4 = 0.8 - real :: d0c3 = 1500.0 - real :: d0c4 = 1500.0 - real :: ekc = 59430.0 !J mol^-1 - real :: eko = 36000.0 !J mol^-1 - real :: gam0 = 28.0E-6 !mol mol^-1 @ 20C = 36.9 @ 25C - real :: gam1 = 0.0509 - real :: gam2 = 0.0010 - real :: gsw03 = 0.01 - real :: gsw04 = 0.04 - real :: rgbwc = 1.32 - real :: rgswc = 1.57 - real :: tmaxj = 45.0 - real :: tmaxv = 45.0 - real :: tminj = -5.0 - real :: tminv = -5.0 - real :: toptj = 20.0 - real :: toptv = 20.0 - real :: trefk= 298.2 !reference temperature K - end type photosynthetic_constants - - - - ! instantiate major types of constants - type( physical_constants ), TARGET :: phys - type( math_constants ), TARGET :: math - type( other_constants ), TARGET :: other - type( photosynthetic_constants ), TARGET :: photo - - - ! TYPEs of local pointers to global constants defined above - - TYPE driver_type - REAL, POINTER :: & - ! physical constants - TFRZ, EMSOIL, EMLEAF, SBOLTZ - END TYPE driver_type - - - TYPE icbm_type - REAL, POINTER :: & - ! physical constants - GRAV, CAPP - END TYPE icbm_type - - - TYPE iair_type - REAL, POINTER :: & - ! physical constants - TFRZ, RMAIR, RGAS, & - TETENA, TETENB, TETENC, & - CAPP, RMH2O, HL - END TYPE iair_type - - - - TYPE ialbedo_type - ! local pointers to global constants defined above - REAL, POINTER :: & - ! physical constants - TFRZ, & - ! other constants - LAI_THRESH, RAD_THRESH - END TYPE ialbedo_type - - - - TYPE icanopy_type - - REAL, POINTER :: & - ! physical constants - TFRZ, RMAIR, RGAS, DHEAT, ZETNEG, & - ZETMUL, ZETPOS, GRAV, UMIN, TETENA, & - TETENB, TETENC, RHOW, CTL, CSW, & - EMLEAF, EMSOIL, SBOLTZ, PRANDT, CAPP, & - RMH2O, APOL, A33, VONK, ZETA0, & - ! photosynthetic constants - RGSWC, GAM0, GAM1, GAM2,CONKO0, CONKC0, & - ALPHA3, ALPHA4, D0C3, D0C4, RGBWC, & - CONVX3, CONVX4, GSW03, GSW04, & - EKC, EKO, TREFK, A1C3, A1C4, & - ! math constants - PI_C, & - ! other constants - LAI_THRESH - - INTEGER, POINTER :: MAXITER - - END TYPE icanopy_type - - - - TYPE icarbon_type - REAL, POINTER :: & - ! physical constants - TFRZ - END TYPE icarbon_type - - - - TYPE irad_type - REAL, POINTER :: & - ! physical constants - TFRZ, EMSOIL, EMLEAF, SBOLTZ, & - CAPP, & - ! other constants - LAI_THRESH, RAD_THRESH, & - ! math constants - PI180, PI_C - REAL, POINTER, DIMENSION(:) :: & - GAUSS_W - END TYPE irad_type - - - TYPE irough_type - REAL, POINTER :: & - ! physical constants - CSD, CRD, CCD, CCW_C, USUHM, VONK, & - A33, CTL, ZDLIN, CSW, GRAV - END TYPE irough_type - - - - TYPE issnow_type - REAL, POINTER :: & - ! physical constants - CAPP, TFRZ, HL, HLF - END TYPE issnow_type - - - - - - - INTERFACE point2constants - MODULE PROCEDURE driver_type_ptr, cbm_type_ptr, air_type_ptr, & - albedo_type_ptr, canopy_type_ptr, carbon_type_ptr, & - rad_type_ptr, rough_type_ptr, ssnow_type_ptr - END INTERFACE - -CONTAINS - - ! SUBRs associating local pointers to global constants defined above - ! given passed TYPE which is locally declared - -SUBROUTINE driver_type_ptr(C) - TYPE(driver_type) :: C - ! physical constants - C%TFRZ => PHYS%TFRZ - C%EMLEAF => PHYS%EMLEAF - C%EMSOIL => PHYS%EMSOIL - C%SBOLTZ => PHYS%SBOLTZ -END SUBROUTINE driver_type_ptr - -! ------------------------------------------------------------------------------ - -SUBROUTINE cbm_type_ptr(C) - TYPE(icbm_type) :: C - ! physical constants - C%GRAV => PHYS%GRAV - C%CAPP => PHYS%CAPP -END SUBROUTINE cbm_type_ptr - -! ------------------------------------------------------------------------------ - -SUBROUTINE air_type_ptr(C) - - TYPE(iair_type) :: C - - C%TFRZ => PHYS%TFRZ - C%RMAIR => PHYS%RMAIR - C%RGAS => PHYS%RGAS - C%TETENA => PHYS%TETENA - C%TETENB => PHYS%TETENB - C%TETENC => PHYS%TETENC - C%CAPP => PHYS%CAPP - C%RMH2O => PHYS%RMH2O - C%HL => PHYS%HL - -END SUBROUTINE air_type_ptr - -! ------------------------------------------------------------------------------ - -SUBROUTINE albedo_type_ptr(C) - TYPE(ialbedo_type) :: C - ! physical constants - C%TFRZ => PHYS%TFRZ - ! other constants - C%LAI_THRESH => OTHER%LAI_THRESH - C%RAD_THRESH => OTHER%RAD_THRESH -END SUBROUTINE albedo_type_ptr - -! ------------------------------------------------------------------------------ - -SUBROUTINE canopy_type_ptr(C) - - TYPE(icanopy_type) :: C - - ! physical constants - C%TFRZ => PHYS%TFRZ - C%RMAIR => PHYS%RMAIR - C%RGAS => PHYS%RGAS - C%DHEAT => PHYS%DHEAT - C%ZETNEG => PHYS%ZETNEG - C%ZETMUL => PHYS%ZETMUL - C%ZETPOS => PHYS%ZETPOS - C%GRAV => PHYS%GRAV - C%UMIN => PHYS%UMIN - C%TETENA => PHYS%TETENA - C%TETENB => PHYS%TETENB - C%TETENC => PHYS%TETENC - C%RHOW => PHYS%RHOW - C%CTL => PHYS%CTL - C%CSW => PHYS%CSW - C%EMLEAF => PHYS%EMLEAF - C%EMSOIL => PHYS%EMSOIL - C%SBOLTZ => PHYS%SBOLTZ - C%PRANDT => PHYS%PRANDT - C%CAPP => PHYS%CAPP - C%RMH2O => PHYS%RMH2O - C%APOL => PHYS%APOL - C%A33 => PHYS%A33 - C%VONK => PHYS%VONK - C%ZETA0 => PHYS%ZETA0 - - C%MAXITER => PHOTO%MAXITER ! only integer here - - !photosynthetic constants - C%RGSWC => PHOTO%RGSWC - C%GAM0 => PHOTO%GAM0 - C%GAM2 => PHOTO%GAM2 - C%CONKC0 => PHOTO%CONKC0 - C%CONKO0 => PHOTO%CONKO0 - C%ALPHA3 => PHOTO%ALPHA3 - C%ALPHA4 => PHOTO%ALPHA4 - C%GSW03 => PHOTO%GSW03 - C%CONVX4 => PHOTO%CONVX4 - C%CONVX3 => PHOTO%CONVX3 - C%D0C3 => PHOTO%D0C3 - C%D0C4 => PHOTO%D0C4 - C%RGBWC => PHOTO%RGBWC - C%GSW04 => PHOTO%GSW04 - C%GAM1 => PHOTO%GAM1 - C%EKO => PHOTO%EKO - C%EKC => PHOTO%EKC - C%TREFK => PHOTO%TREFK - C%A1C3 => PHOTO%A1C3 - C%A1C4 => PHOTO%A1C4 - - ! math constants - C%PI_C => MATH%PI_C - - ! other constants - C%LAI_THRESH => OTHER%LAI_THRESH - -END SUBROUTINE canopy_type_ptr - -! ------------------------------------------------------------------------------ - -SUBROUTINE carbon_type_ptr(C) - TYPE(icarbon_type) :: C - ! physical constants - C%TFRZ => PHYS%TFRZ -END SUBROUTINE carbon_type_ptr - -! ------------------------------------------------------------------------------ - -SUBROUTINE rad_type_ptr(C) - TYPE(irad_type) :: C - - ! other constants - C%LAI_THRESH => OTHER%LAI_THRESH - C%RAD_THRESH => OTHER%RAD_THRESH - C%GAUSS_W => OTHER%GAUSS_W - - ! math constants - C%PI180 => MATH%PI180 - C%PI_C => MATH%PI_C - - ! physical constants - C%TFRZ => PHYS%TFRZ - C%EMLEAF => PHYS%EMLEAF - C%EMSOIL => PHYS%EMSOIL - C%SBOLTZ => PHYS%SBOLTZ - C%CAPP => PHYS%CAPP - -END SUBROUTINE rad_type_ptr - -! ------------------------------------------------------------------------------ - -SUBROUTINE rough_type_ptr(C) - TYPE(irough_type) :: C - ! physical constants - C%CSD => PHYS%CSD - C%CRD => PHYS%CRD - C%CCD => PHYS%CCD - C%CSW => PHYS%CSW - C%CCW_C => PHYS%CCW_C - C%USUHM => PHYS%USUHM - C%VONK => PHYS%VONK - C%A33 => PHYS%A33 - C%CTL => PHYS%CTL - C%ZDLIN => PHYS%ZDLIN - C%GRAV => PHYS%GRAV -END SUBROUTINE rough_type_ptr - -! ------------------------------------------------------------------------------ - -SUBROUTINE ssnow_type_ptr(C) - TYPE(issnow_type) :: C - ! physical constants - C%CAPP => PHYS%CAPP - C%TFRZ => PHYS%TFRZ - C%HL => PHYS%HL - C%HLF => PHYS%HLF - !C% => PHYS% -END SUBROUTINE ssnow_type_ptr - -END MODULE cable_data_module - diff --git a/src/coupled/ESM1.5/CABLEfilesFromESM1.5/cable_explicit_driver.F90 b/src/coupled/ESM1.5/CABLEfilesFromESM1.5/cable_explicit_driver.F90 index ed938279a..e65a28b18 100644 --- a/src/coupled/ESM1.5/CABLEfilesFromESM1.5/cable_explicit_driver.F90 +++ b/src/coupled/ESM1.5/CABLEfilesFromESM1.5/cable_explicit_driver.F90 @@ -88,6 +88,9 @@ SUBROUTINE cable_explicit_driver( row_length, rows, land_pts, ntiles,npft, & USE feedback_mod +! data +USE cable_phys_constants_mod, ONLY: CAPP + IMPLICIT NONE @@ -440,7 +443,6 @@ SUBROUTINE cable_expl_unpack( FTL_TILE_CAB, FTL_CAB, FTL_TILE, FQW_TILE, & rad_transd, rough_z0m, rough_zref_tq ) USE cable_def_types_mod, ONLY : mp, NITER - USE cable_data_module, ONLY : PHYS USE cable_um_tech_mod, ONLY : um1 USE cable_common_module, ONLY : cable_runtime, cable_user, & ktau_gl, knode_gl @@ -561,10 +563,7 @@ SUBROUTINE cable_expl_unpack( FTL_TILE_CAB, FTL_CAB, FTL_TILE, FQW_TILE, & INTEGER :: i,j,k,N,L REAL :: miss = 0.0 LOGICAL, SAVE :: first_cable_call = .true. - REAL, POINTER :: CAPP - CAPP => PHYS%CAPP - !___return fluxes FTL_TILE_CAB = UNPACK(canopy_fh, um1%l_tile_pts, miss) FTL_CAB = SUM(um1%TILE_FRAC * FTL_TILE_CAB,2) diff --git a/src/coupled/ESM1.5/CABLEfilesFromESM1.5/cable_hyd_driver.F90 b/src/coupled/ESM1.5/CABLEfilesFromESM1.5/cable_hyd_driver.F90 index fd6c004c8..a7b37e1fc 100644 --- a/src/coupled/ESM1.5/CABLEfilesFromESM1.5/cable_hyd_driver.F90 +++ b/src/coupled/ESM1.5/CABLEfilesFromESM1.5/cable_hyd_driver.F90 @@ -34,7 +34,6 @@ SUBROUTINE cable_hyd_driver( SNOW_TILE, LYING_SNOW, SURF_ROFF, SUB_SURF_ROFF, & TOT_TFALL, WB_LAKE ) - USE cable_data_module, ONLY : PHYS, OTHER USE cable_common_module!, only : cable_runtime, cable_user USE cable_um_tech_mod, only : um1, ssnow, canopy, veg IMPLICIT NONE @@ -57,9 +56,6 @@ SUBROUTINE cable_hyd_driver( SNOW_TILE, LYING_SNOW, SURF_ROFF, SUB_SURF_ROFF, & WB_LAKE ! unpack CABLE wb_lake REAL :: miss =0. - REAL, POINTER :: TFRZ - - TFRZ => PHYS%TFRZ SNOW_TILE= UNPACK(ssnow%snowd, um1%L_TILE_PTS, miss) LYING_SNOW = SUM(um1%TILE_FRAC * SNOW_TILE,2) !gridbox snow mass diff --git a/src/coupled/ESM1.5/CABLEfilesFromESM1.5/cable_implicit_driver.F90 b/src/coupled/ESM1.5/CABLEfilesFromESM1.5/cable_implicit_driver.F90 index 4604c3377..a0b843909 100644 --- a/src/coupled/ESM1.5/CABLEfilesFromESM1.5/cable_implicit_driver.F90 +++ b/src/coupled/ESM1.5/CABLEfilesFromESM1.5/cable_implicit_driver.F90 @@ -29,10 +29,6 @@ ! ! ============================================================================== - - !USE cable_data_module, ONLY : PHYS - !REAL, POINTER :: TFRZ - ! TFRZ => PHYS%TFRZ subroutine cable_implicit_driver( LS_RAIN, CON_RAIN, LS_SNOW, CONV_SNOW, & DTL_1,DQW_1, TSOIL, TSOIL_TILE, SMCL, & SMCL_TILE, timestep, SMVCST,STHF, STHF_TILE, & @@ -57,9 +53,9 @@ subroutine cable_implicit_driver( LS_RAIN, CON_RAIN, LS_SNOW, CONV_SNOW, & NPP_FT_ACC,RESP_W_FT_ACC,RESP_S_ACC, & FNSNET,FNLEACH,FNUP,FNLOSS,FNDEP,FNFIX,idoy ) - USE cable_def_types_mod, ONLY : mp - USE cable_data_module, ONLY : PHYS - USE cable_um_tech_mod, ONLY : um1, conv_rain_prevstep, conv_snow_prevstep,& + USE cable_def_types_mod, ONLY: mp + USE cable_phys_constants_mod, ONLY: TFRZ + USE cable_um_tech_mod, ONLY: um1, conv_rain_prevstep, conv_snow_prevstep,& air, bgc, canopy, met, bal, rad, rough, soil,& ssnow, sum_flux, veg, climate USE cable_common_module, ONLY : cable_runtime, cable_user, l_casacnp, & @@ -242,13 +238,10 @@ subroutine cable_implicit_driver( LS_RAIN, CON_RAIN, LS_SNOW, CONV_SNOW, & dtlc, & dqwc - REAL, POINTER :: TFRZ INTEGER, PARAMETER :: loy = 365 !fudge for ESM1.5 INTEGER, PARAMETER :: lalloc = 0 !fudge for ESM1.5 0 => call POP N/A TYPE(POP_TYPE) :: POP - TFRZ => PHYS%TFRZ - ! FLAGS def. specific call to CABLE from UM cable_runtime%um_explicit = .FALSE. cable_runtime%um_implicit = .TRUE. @@ -363,10 +356,10 @@ SUBROUTINE implicit_unpack( TSOIL, TSOIL_TILE, SMCL, SMCL_TILE, & TRANSP_TILE, NPP_FT_ACC, RESP_W_FT_ACC, RESP_S_ACC,& FNSNET,FNLEACH,FNUP,FNLOSS,FNDEP,FNFIX) - USE cable_def_types_mod, ONLY : mp - USE cable_data_module, ONLY : PHYS - USE cable_um_tech_mod, ONLY : um1 ,canopy, rad, soil, ssnow, air - USE cable_common_module, ONLY : cable_runtime, cable_user + USE cable_def_types_mod, ONLY: mp + USE cable_phys_constants_mod, ONLY: TFRZ + USE cable_um_tech_mod, ONLY: um1 ,canopy, rad, soil, ssnow, air + USE cable_common_module, ONLY: cable_runtime, cable_user USE casa_types_mod IMPLICIT NONE @@ -505,11 +498,6 @@ SUBROUTINE implicit_unpack( TSOIL, TSOIL_TILE, SMCL, SMCL_TILE, & INTEGER:: i_miss = 0 REAL :: miss = 0.0 - REAL, POINTER :: TFRZ - - - TFRZ => PHYS%TFRZ - !--- set UM vars to zero TSOIL_CAB = 0.; SMCL_CAB = 0.; TSOIL_TILE = 0.; SMCL_TILE = 0.; STHF_TILE = 0.; STHU_TILE = 0. diff --git a/src/coupled/ESM1.5/CABLEfilesFromESM1.5/cable_um_init_subrs.F90 b/src/coupled/ESM1.5/CABLEfilesFromESM1.5/cable_um_init_subrs.F90 index 15fe3264d..03d659f92 100644 --- a/src/coupled/ESM1.5/CABLEfilesFromESM1.5/cable_um_init_subrs.F90 +++ b/src/coupled/ESM1.5/CABLEfilesFromESM1.5/cable_um_init_subrs.F90 @@ -35,7 +35,7 @@ MODULE cable_um_init_subrs_mod !jhan: code under development for future release ! subroutine initialize_maps(latitude,longitude, tile_index_mp) -! use cable_data_module, only : cable, const +! USE cable_phys_constants_mod, ONLY: ! use cable_um_tech_mod, only : um1 ! use define_dimensions, only : mp ! @@ -491,7 +491,8 @@ SUBROUTINE initialize_radiation( sw_down, lw_down, cos_zenith_angle, & CO2_MMR,CO2_3D,CO2_DIM_LEN,CO2_DIM_ROW,L_CO2_INTERACTIVE ) USE cable_def_types_mod, ONLY : mp - USE cable_data_module, ONLY : PHYS, OTHER + USE cable_phys_constants_mod, ONLY: TFRZ + USE cable_other_constants_mod, ONLY: RAD_thresh USE cable_um_tech_mod, ONLY : um1, rad, soil, met, & conv_rain_prevstep, conv_snow_prevstep USE cable_common_module, ONLY : cable_runtime, cable_user @@ -525,11 +526,6 @@ SUBROUTINE initialize_radiation( sw_down, lw_down, cos_zenith_angle, & !___defs 1st call to CABLE in this run. OK in UM & coupled LOGICAL, SAVE :: first_call= .TRUE. - REAL, POINTER :: TFRZ, RAD_THRESH - - TFRZ => PHYS%TFRZ - RAD_THRESH => OTHER%RAD_THRESH - IF( first_call ) THEN rad%albedo_T = soil%albsoil(:,1) first_call = .FALSE. @@ -643,7 +639,7 @@ SUBROUTINE initialize_soilsnow( smvcst, tsoil_tile, sthf_tile, smcl_tile, & sin_theta_latitude ) USE cable_def_types_mod, ONLY : mp, msn - USE cable_data_module, ONLY : PHYS + USE cable_phys_constants_mod, ONLY: TFRZ USE cable_um_tech_mod, ONLY : um1, soil, ssnow, met, bal, veg USE cable_common_module, ONLY : cable_runtime, cable_user @@ -677,7 +673,6 @@ SUBROUTINE initialize_soilsnow( smvcst, tsoil_tile, sthf_tile, smcl_tile, & INTEGER :: i,j,k,L,n REAL :: zsetot, max_snow_depth=50000. REAL, ALLOCATABLE:: fwork(:,:,:), sfact(:), fvar(:), rtemp(:) - REAL, POINTER :: TFRZ LOGICAL :: skip =.TRUE. LOGICAL :: first_call = .TRUE. @@ -687,8 +682,6 @@ SUBROUTINE initialize_soilsnow( smvcst, tsoil_tile, sthf_tile, smcl_tile, & ssnow%wbtot2 = 0 ssnow%wb_lake = 0. - TFRZ => PHYS%TFRZ - snow_tile = MIN(max_snow_depth, snow_tile) ssnow%snowd = PACK(SNOW_TILE,um1%l_tile_pts) diff --git a/src/coupled/ESM1.5/casa_um_inout.F90 b/src/coupled/ESM1.5/casa_um_inout.F90 index c5ed951c2..8a3da964a 100644 --- a/src/coupled/ESM1.5/casa_um_inout.F90 +++ b/src/coupled/ESM1.5/casa_um_inout.F90 @@ -133,8 +133,8 @@ SUBROUTINE casa_readpoint_pk(sin_theta_latitude,veg,soil,casaflux,casamet, & USE cable_um_tech_mod, ONLY : um1 USE casavariable USE casaparm - USE cable_um_init_subrs_mod, ONLY : um2cable_rr, um2cable_lp - USE cable_data_module, ONLY : MATH + USE cable_um_init_subrs_mod, ONLY: um2cable_rr, um2cable_lp + USE cable_math_constants_mod, ONLY: PI180 ! USE math_constants IMPLICIT NONE @@ -178,7 +178,7 @@ SUBROUTINE casa_readpoint_pk(sin_theta_latitude,veg,soil,casaflux,casamet, & annNfert = 4.3/365.0 ! pack variables - call um2cable_rr((asin(sin_theta_latitude)/math%pi180) ,casamet%lat) + call um2cable_rr((asin(sin_theta_latitude)/PI180) ,casamet%lat) !call um2cable_rr(um1%latitude ,casamet%lat) call um2cable_rr(um1%longitude,casamet%lon) ! Lest Nov2011 - not correct, but areacell not needed/used for UM ? diff --git a/src/science/gw_hydro/cable_gw_hydro.F90 b/src/science/gw_hydro/cable_gw_hydro.F90 index 1807f29f9..4d4380306 100644 --- a/src/science/gw_hydro/cable_gw_hydro.F90 +++ b/src/science/gw_hydro/cable_gw_hydro.F90 @@ -47,7 +47,6 @@ MODULE cable_gw_hydro_module ! USE cbl_soil_snow_subrs_module, ONLY : trimb, snow_processes_soil_thermal ! replaced below by rk4417 - phase2 ! line below commented out by rk4417 - phase2 -! USE cable_data_module, only: C=>PHYS ! all constants used in this module belong to PHYS !distribute these per sbr ! added by rk4417 - phase2 From eb2912a86caf13fd568745efe0fa9b459a810938 Mon Sep 17 00:00:00 2001 From: "Srbinovsky, Jhan (O&A, Aspendale)" Date: Mon, 4 Nov 2024 17:16:44 +1100 Subject: [PATCH 2/2] review updates --- .../ESM1.5/CABLEfilesFromESM1.5/cable_cbm.F90 | 2 -- .../CABLEfilesFromESM1.5/cable_explicit_driver.F90 | 13 ++++++------- .../CABLEfilesFromESM1.5/cable_implicit_driver.F90 | 1 - .../CABLEfilesFromESM1.5/cable_um_init_subrs.F90 | 2 -- 4 files changed, 6 insertions(+), 12 deletions(-) diff --git a/src/coupled/ESM1.5/CABLEfilesFromESM1.5/cable_cbm.F90 b/src/coupled/ESM1.5/CABLEfilesFromESM1.5/cable_cbm.F90 index 24ea3a430..b46026ea8 100644 --- a/src/coupled/ESM1.5/CABLEfilesFromESM1.5/cable_cbm.F90 +++ b/src/coupled/ESM1.5/CABLEfilesFromESM1.5/cable_cbm.F90 @@ -37,8 +37,6 @@ SUBROUTINE cbm( dels, air, bgc, canopy, met, & USE casadimension, ONLY: icycle USE cable_phys_constants_mod, ONLY: GRAV, CAPP - !ptrs to local constants - TYPE( icbm_type ) :: C ! CABLE model variables TYPE (air_type), INTENT(INOUT) :: air TYPE (bgc_pool_type), INTENT(INOUT) :: bgc diff --git a/src/coupled/ESM1.5/CABLEfilesFromESM1.5/cable_explicit_driver.F90 b/src/coupled/ESM1.5/CABLEfilesFromESM1.5/cable_explicit_driver.F90 index e65a28b18..082e96cfb 100644 --- a/src/coupled/ESM1.5/CABLEfilesFromESM1.5/cable_explicit_driver.F90 +++ b/src/coupled/ESM1.5/CABLEfilesFromESM1.5/cable_explicit_driver.F90 @@ -88,9 +88,6 @@ SUBROUTINE cable_explicit_driver( row_length, rows, land_pts, ntiles,npft, & USE feedback_mod -! data -USE cable_phys_constants_mod, ONLY: CAPP - IMPLICIT NONE @@ -442,10 +439,12 @@ SUBROUTINE cable_expl_unpack( FTL_TILE_CAB, FTL_CAB, FTL_TILE, FQW_TILE, & canopy_zetar, canopy_epot, met_ua, rad_trad, & rad_transd, rough_z0m, rough_zref_tq ) - USE cable_def_types_mod, ONLY : mp, NITER - USE cable_um_tech_mod, ONLY : um1 - USE cable_common_module, ONLY : cable_runtime, cable_user, & - ktau_gl, knode_gl +! data +USE cable_phys_constants_mod, ONLY: CAPP +USE cable_def_types_mod, ONLY : mp, NITER +USE cable_um_tech_mod, ONLY : um1 +USE cable_common_module, ONLY : cable_runtime, cable_user, & + ktau_gl, knode_gl IMPLICIT NONE diff --git a/src/coupled/ESM1.5/CABLEfilesFromESM1.5/cable_implicit_driver.F90 b/src/coupled/ESM1.5/CABLEfilesFromESM1.5/cable_implicit_driver.F90 index a0b843909..31bc211f8 100644 --- a/src/coupled/ESM1.5/CABLEfilesFromESM1.5/cable_implicit_driver.F90 +++ b/src/coupled/ESM1.5/CABLEfilesFromESM1.5/cable_implicit_driver.F90 @@ -54,7 +54,6 @@ subroutine cable_implicit_driver( LS_RAIN, CON_RAIN, LS_SNOW, CONV_SNOW, & FNSNET,FNLEACH,FNUP,FNLOSS,FNDEP,FNFIX,idoy ) USE cable_def_types_mod, ONLY: mp - USE cable_phys_constants_mod, ONLY: TFRZ USE cable_um_tech_mod, ONLY: um1, conv_rain_prevstep, conv_snow_prevstep,& air, bgc, canopy, met, bal, rad, rough, soil,& ssnow, sum_flux, veg, climate diff --git a/src/coupled/ESM1.5/CABLEfilesFromESM1.5/cable_um_init_subrs.F90 b/src/coupled/ESM1.5/CABLEfilesFromESM1.5/cable_um_init_subrs.F90 index 03d659f92..80f47e6bc 100644 --- a/src/coupled/ESM1.5/CABLEfilesFromESM1.5/cable_um_init_subrs.F90 +++ b/src/coupled/ESM1.5/CABLEfilesFromESM1.5/cable_um_init_subrs.F90 @@ -491,7 +491,6 @@ SUBROUTINE initialize_radiation( sw_down, lw_down, cos_zenith_angle, & CO2_MMR,CO2_3D,CO2_DIM_LEN,CO2_DIM_ROW,L_CO2_INTERACTIVE ) USE cable_def_types_mod, ONLY : mp - USE cable_phys_constants_mod, ONLY: TFRZ USE cable_other_constants_mod, ONLY: RAD_thresh USE cable_um_tech_mod, ONLY : um1, rad, soil, met, & conv_rain_prevstep, conv_snow_prevstep @@ -639,7 +638,6 @@ SUBROUTINE initialize_soilsnow( smvcst, tsoil_tile, sthf_tile, smcl_tile, & sin_theta_latitude ) USE cable_def_types_mod, ONLY : mp, msn - USE cable_phys_constants_mod, ONLY: TFRZ USE cable_um_tech_mod, ONLY : um1, soil, ssnow, met, bal, veg USE cable_common_module, ONLY : cable_runtime, cable_user