Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,8 @@ else()
src/shared/casa_offline_inout.F90
src/shared/casa_ncdf.F90
src/offline/cable_iovars.F90
src/offline/temp_module.F90
src/shared/read_namelists_mod_cbl.F90
src/offline/cable_surface_types.F90
src/offline/cable_define_types.F90
src/shared/cable_phenology.F90
Expand Down
30 changes: 30 additions & 0 deletions namelists/cable.nml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
&cable

!BGC
l_casacnp = .FALSE. ! using casaCNP with CABLE
l_laiFeedbk = .FALSE. ! using prognostic LAI
l_vcmaxFeedbk = .FALSE. ! using prognostic Vcmax
icycle = 0 ! [0 (=NO casaCNP), 1 (=C), 2 (=C+N), 3 (=C+N+P) ]
cable_user%DIAG_SOIL_RESP = 'ON '
cable_user%LEAF_RESPIRATION = 'ON '

!canopy
wiltParam = 0.5 !
satuParam = 0.8 !
cable_user%FWSOIL_SWITCH = 'standard' ! ['standard', 'non-linear extrapolation',
'Lai and Ktaul' 2000, 'Haverd2013' ]
cable_user%GS_SWITCH = 'leuning' ! stomata model ['leuning', 'Medlyn']
cable_user%SSNOW_POTEV = 'HDM' ! ['HDM' (Humidity Deficit Method),
'P-M' (Penmann-Monteith model) ]
!soilsnow
redistrb = .FALSE. ! Execute hydraulic redistribution model
snmin = 1.0 ! minimum snow depth to use 3 layer model

! offline ONLY
cable_user%l_ice_consistency = .FALSE. ! TRUE add QA step for ice tiles input.
cable_user%RUN_DIAG_LEVEL = 'BASIC' ! [ 'BASIC', 'NONE' ]
cable_user%CONSISTENCY_CHECK = .TRUE. ! TRUE outputs combined fluxes at each timestep for comparisson to A control run
cable_user%CASA_DUMP_READ = .FALSE. ! TRUE reads CASA forcing from netcdf format
cable_user%CASA_DUMP_WRITE = .FALSE. ! TRUE outputs CASA forcing in netcdf format

&end
File renamed without changes.
48 changes: 48 additions & 0 deletions namelists/offline.nml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
&offline

filename%met = 'TumbaFluxnet.1.3_met.nc'
filename%out = 'out_cable.nc'
filename%log = 'log_cable.txt'
filename%restart_in = ' '
filename%restart_out = './restart_out.nc'
filename%type = 'gridinfo_CSIRO_1x1.nc'

vegparmnew = .TRUE. ! using new format when true
soilparmnew = .TRUE. ! using new format when true

spinup = .FALSE. ! do we spin up the model?
delsoilM = 0.001 ! threshold variation in soil moisture for spin up
delsoilT = 0.01 ! threshold variation in soil temperature for spin up
spincasa = .FALSE. ! spin casa before running the model if TRUE

output%restart = .TRUE. ! should a restart file be created?
output%met = .TRUE. ! input met data
output%flux = .TRUE. ! convective, runoff, NEE
output%soil = .FALSE. !see #354 soil statescrews up dimensions for ferret
output%snow = .TRUE. ! snow states
output%radiation = .TRUE. ! net rad, albedo
output%carbon = .TRUE. ! NEE, GPP, NPP, stores
output%veg = .TRUE. ! vegetation states
output%params = .TRUE. ! input parameters used to produce run
output%patch = .TRUE. ! write per patch
output%balances = .TRUE. ! energy and water balances
check%ranges = 0 ! variable ranges, input and output
check%energy_bal = .TRUE. ! energy balance
check%mass_bal = .TRUE. ! water/mass balance

verbose = .TRUE. ! write details of every grid cell init and params to log?
leaps = .TRUE. ! calculate timing with leap years?
logn = 88 ! log file number - declared in input module
fixedCO2 = 350.0 ! if not found in met file, in ppmv

ncciy = 0 ! 0 = NO GSWP2; 4-digit year input for year of GSWP2 met
gswpfile%rainf = 'gswp/Rainf_gswp1987.nc'
gswpfile%snowf = 'gswp/Snowf_gswp1987.nc'
gswpfile%LWdown= 'gswp/LWdown_srb1987.nc'
gswpfile%SWdown= 'gswp/SWdown_srb1987.nc'
gswpfile%PSurf = 'gswp/PSurf_ecor1987.nc'
gswpfile%Qair = 'gswp/Qair_cru1987.nc'
gswpfile%Tair = 'gswp/Tair_cru1987.nc'
gswpfile%wind = 'gswp/Wind_ncep1987.nc'

&end
File renamed without changes.
73 changes: 0 additions & 73 deletions src/offline/cable.nml

This file was deleted.

70 changes: 14 additions & 56 deletions src/offline/cable_driver_common.F90
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ MODULE cable_driver_common_mod
verbose, &
leaps, &
logn, &
fixedCO2, &
ncciy, &
gswpfile, &
globalMetfile, &
Expand All @@ -42,6 +41,16 @@ MODULE cable_driver_common_mod
USE CABLE_PLUME_MIP, ONLY : PLUME_MIP_TYPE, PLUME_MIP_INIT
USE CABLE_CRU, ONLY : CRU_TYPE, CRU_INIT
USE CABLE_site, ONLY : site_TYPE, site_INIT
USE read_namelists_mod_cbl, ONLY: read_cable_namelists

USE temp_module, ONLY: spincasa, &
spinup, &
CASAONLY, &
l_casacnp, &
l_laiFeedbk, &
l_vcmaxFeedbk, &
LALLOC

IMPLICIT NONE
PRIVATE

Expand All @@ -50,56 +59,8 @@ MODULE cable_driver_common_mod
!! Number of GSWP met forcing variables (rain, snow, lw, sw, ps, qa, ta, wd)
REAL, PARAMETER :: CONSISTENCY_CHECK_TOLERANCE = 1.e-7
!! Max tolerance value for quasi-bit reproducibility checks

LOGICAL, SAVE, PUBLIC :: vegparmnew = .FALSE. ! using new format input file (BP dec 2007)
LOGICAL, SAVE, PUBLIC :: spinup = .FALSE. ! model spinup to soil state equilibrium?
LOGICAL, SAVE, PUBLIC :: spincasa = .FALSE. ! TRUE: CASA-CNP Will spin mloop times, FALSE: no spin up
LOGICAL, SAVE, PUBLIC :: CASAONLY = .FALSE. ! ONLY Run CASA-CNP
LOGICAL, SAVE, PUBLIC :: l_casacnp = .FALSE. ! using CASA-CNP with CABLE
LOGICAL, SAVE, PUBLIC :: l_landuse = .FALSE. ! using CASA-CNP with CABLE
LOGICAL, SAVE, PUBLIC :: l_laiFeedbk = .FALSE. ! using prognostic LAI
LOGICAL, SAVE, PUBLIC :: l_vcmaxFeedbk = .FALSE. ! using prognostic Vcmax

REAL, SAVE, PUBLIC :: delsoilM ! allowed variation in soil moisture for spin up
REAL, SAVE, PUBLIC :: delsoilT ! allowed variation in soil temperature for spin up
REAL, SAVE, PUBLIC :: delgwM = 1e-4

INTEGER, SAVE, PUBLIC :: LALLOC = 0 ! allocation coefficient for passing to spincasa

NAMELIST /CABLE/ &
filename, & ! TYPE, containing input filenames
vegparmnew, & ! use new soil param. method
soilparmnew, & ! use new soil param. method
calcsoilalbedo, & ! albedo considers soil color Ticket #27
spinup, & ! spinup model (soil) to steady state
delsoilM, &
delsoilT, &
delgwM, &
output, &
patchout, &
check, &
verbose, &
leaps, &
logn, &
fixedCO2, &
spincasa, &
l_casacnp, &
l_landuse, &
l_laiFeedbk, &
l_vcmaxFeedbk, &
CASAONLY, &
icycle, &
casafile, &
ncciy, &
gswpfile, &
globalMetfile, &
redistrb, &
wiltParam, &
satuParam, &
snmin, &
cable_user, & ! additional USER switches
gw_params

INTEGER, PARAMETER :: nmlunitnumber = 88813 ! this is to satisfy UM method
! where a shared_unitnumber is used
PUBLIC :: cable_driver_init
PUBLIC :: cable_driver_init_gswp
PUBLIC :: cable_driver_init_plume
Expand Down Expand Up @@ -131,13 +92,10 @@ SUBROUTINE cable_driver_init(mpi_grp, NRRRR)
WRITE(*,*) "THE NAME LIST IS ", CABLE_NAMELIST
END IF

! Open, read and close the namelist file.
OPEN(NEWUNIT=unit, FILE=CABLE_NAMELIST, STATUS="OLD", ACTION="READ")
READ(unit, NML=CABLE)
CLOSE(unit)

cable_runtime%offline = .TRUE.

CALL read_cable_namelists( nmlunitnumber )

! Open log file:
IF (mpi_grp%rank == 0) THEN
OPEN(logn, FILE=filename%log)
Expand Down
25 changes: 13 additions & 12 deletions src/offline/cable_serial.F90
Original file line number Diff line number Diff line change
Expand Up @@ -62,18 +62,6 @@ MODULE cable_serial
!! Offline serial driver for CABLE.
USE cable_driver_common_mod, ONLY : &
cable_driver_init, &
vegparmnew, &
spinup, &
spincasa, &
CASAONLY, &
l_casacnp, &
l_landuse, &
l_laiFeedbk, &
l_vcmaxFeedbk, &
delsoilM, &
delsoilT, &
delgwM, &
LALLOC, &
prepareFiles, &
prepareFiles_princeton, &
LUCdriver, &
Expand Down Expand Up @@ -150,6 +138,19 @@ MODULE cable_serial
USE landuse_variable
USE bgcdriver_mod, ONLY : bgcdriver
USE casa_offline_inout_module, ONLY : WRITE_CASA_RESTART_NC, WRITE_CASA_OUTPUT_NC
USE temp_module, ONLY: vegparmnew, &
spinup, &
spincasa, &
CASAONLY, &
l_landuse, &
l_casacnp, &
l_laiFeedbk, &
l_vcmaxFeedbk, &
delsoilM, &
delsoilT, &
delgwM, &
LALLOC

IMPLICIT NONE

PRIVATE
Expand Down
18 changes: 18 additions & 0 deletions src/offline/temp_module.F90
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
MODULE temp_module

LOGICAL, SAVE, PUBLIC :: vegparmnew = .FALSE. ! using new format input file (BP dec 2007)
LOGICAL, SAVE, PUBLIC :: spinup = .FALSE. ! model spinup to soil state equilibrium?
LOGICAL, SAVE, PUBLIC :: spincasa = .FALSE. ! TRUE: CASA-CNP Will spin mloop times, FALSE: no spin up
LOGICAL, SAVE, PUBLIC :: CASAONLY = .FALSE. ! ONLY Run CASA-CNP
LOGICAL, SAVE, PUBLIC :: l_casacnp = .FALSE. ! using CASA-CNP with CABLE
LOGICAL, SAVE, PUBLIC :: l_landuse = .FALSE. ! using CASA-CNP with CABLE
LOGICAL, SAVE, PUBLIC :: l_laiFeedbk = .FALSE. ! using prognostic LAI
LOGICAL, SAVE, PUBLIC :: l_vcmaxFeedbk = .FALSE. ! using prognostic Vcmax

REAL, SAVE, PUBLIC :: delsoilM ! allowed variation in soil moisture for spin up
REAL, SAVE, PUBLIC :: delsoilT ! allowed variation in soil temperature for spin up
REAL, SAVE, PUBLIC :: delgwM = 1e-4

INTEGER, SAVE, PUBLIC :: LALLOC = 0 ! alloc coeff passed to spincasa

END MODULE temp_module
Loading
Loading