diff --git a/CMakeLists.txt b/CMakeLists.txt index 3fece347e..2f4edee91 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -17,6 +17,7 @@ set(OIFS_COUPLED OFF CACHE BOOL "compile fesom coupled to OpenIFS. (Also set(CRAY OFF CACHE BOOL "compile with cray ftn") set(USE_ICEPACK OFF CACHE BOOL "compile fesom with the Iceapck modules for sea ice column physics.") set(OPENMP_REPRODUCIBLE OFF CACHE BOOL "serialize OpenMP loops that are critical for reproducible results") + set(RECOM_COUPLED OFF CACHE BOOL "compile fesom including biogeochemistry, REcoM3") set(CISO_COUPLED OFF CACHE BOOL "compile ciso coupled to REcoM3. RECOM_COUPLED has to be active") set(USE_MULTIO OFF CACHE BOOL "Use MULTIO for IO, either grib or binary for now. This also means path to MULTIO installation has to provided using env MULTIO_INSTALL_PATH='..' and multio configuration yamls must be present to run the model with MULTIO") diff --git a/config/bin_2p1z1d/job_albedo b/config/bin_2p1z1d/job_albedo index bac3e2b3a..a9d157b2c 100755 --- a/config/bin_2p1z1d/job_albedo +++ b/config/bin_2p1z1d/job_albedo @@ -1,16 +1,15 @@ #!/bin/bash -#SBATCH --account=nwg_hauck.maresys # edit your account -#SBATCH --job-name=recom +#SBATCH --account=nwg_maresys.maresys +#SBATCH --job-name=2p1z1d #SBATCH --partition=mpp -#SBATCH --time=01:30:00 -####SBATCH --constraint="[rack1|rack3]" +#SBATCH -N 9 +#SBATCH --cpus-per-task=1 +#SBATCH --time=08:00:00 #SBATCH --qos=12h -#SBATCH --nodes=9 # Number of tasks (MPI) tasks to be launched -#SBATCH --tasks-per-node 96 #8 #4 # using all 128CPus we exceed the maxload limit (>130) of many used nodes when us parallel I/O -#SBATCH --cpus-per-task 1 +#SBATCH --tasks-per-node 96 # using all 128CPus we exceed the maxload limit (>130) of many used nodes when us parallel I/O -#SBATCH -o fesom2o.out -#SBATCH -e fesom2e.out +#SBATCH -o slurm-out.out +#SBATCH -e slurm-err.out # disable hyperthreading #SBATCH --hint=nomultithread @@ -24,34 +23,32 @@ ulimit -s unlimited JOBID=`echo $SLURM_JOB_ID |cut -d"." -f1` ln -s ../bin/fesom.x . # cp -n ../bin/fesom.x -cp -n ../config/namelist.config . -cp -n ../config/namelist.forcing . -cp -n ../config/namelist.oce . -cp -n ../config/namelist.dyn . -cp -n ../config/namelist.tra . -cp -n ../config/namelist.ice . -cp -n ../config/namelist.io . -cp -n ../config/namelist.icepack . +#cp -n ../config/namelist.config . +#cp -n ../config/namelist.forcing . +#cp -n ../config/namelist.oce . +#cp -n ../config/namelist.dyn . +#cp -n ../config/namelist.tra . +#cp -n ../config/namelist.ice . +#cp -n ../config/namelist.io . +#cp -n ../config/namelist.icepack . #___DETERMINE SLURM JOBID+OUTPUTFILE____________________________________________ jobid=$(echo $SLURM_JOB_ID | cut -d"." -f1) -fname="fesom2_${SLURM_JOB_NAME}_${jobid}.out" +fname="fesom2.0.out" #___PUT JOB IN QUEUE____________________________________________________________ date -####srun --mpi=pmi2 ./fesom.x >> ${fname} srun --mpi=pmi2 ./fesom.x > fesom2.0.out date #qstat -f $PBS_JOBID #export EXITSTATUS=$? #if [ ${EXITSTATUS} -eq 0 ] || [ ${EXITSTATUS} -eq 127 ] ; then -#sbatch job_ollie +#sbatch job_albedo #fi -#Resultpath='/albedo/scratch/user/ogurses/ocean_only/' -Resultpath='/albedo/scratch/user/ogurses/fesom2.5_recom_st1_vsink_vben_diags/' -test -d $Resultpath/fesom.2019.oce.restart && exit +Resultpath='/albedo/work/user/...' +test -e $Resultpath/fesom.2019.oce.restart && exit IsInFile=$( tail -3 fesom2.0.out | grep -c timesteps) if (( IsInFile > 0 )); then diff --git a/config/bin_2p1z1d/namelist.config b/config/bin_2p1z1d/namelist.config index eb9a4375d..ffff081c0 100644 --- a/config/bin_2p1z1d/namelist.config +++ b/config/bin_2p1z1d/namelist.config @@ -6,8 +6,8 @@ runid='fesom' ×tep step_per_day=32 !96 !96 !72 !72 !45 !72 !96 -run_length=1 !62 !62 !62 !28 -run_length_unit='y' ! y, m, d, s +run_length= 1 !62 !62 !62 !28 +run_length_unit='y' ! y, m, d, s / &clockinit ! the model starts at @@ -18,8 +18,8 @@ yearnew=1958 &paths MeshPath='/albedo/work/projects/p_recompdaf/frbunsen/FESOM2/meshes/core2/' -ClimateDataPath='/albedo/work/projects/MarESys/ogurses/input/corrected_input/' -ResultPath='/albedo/scratch/user/ogurses/fesom2.5_recom_st1_vsink_vben_diags/' +ClimateDataPath='/albedo/work/projects/MarESys/ogurses/input/corrected_input/' +ResultPath='/albedo/work/user/...' / &restart_log @@ -29,7 +29,7 @@ raw_restart_length=1 ! --> do core dump restart raw_restart_length_unit='off' ! e.g. y, d, h, s, off bin_restart_length=1 ! --> do derived type binary restart bin_restart_length_unit='off' ! e.g. y, d, h, s, off -logfile_outfreq=960 !in logfile info. output frequency, # steps +logfile_outfreq=960 !in logfile info. output frequency, # steps / &ale_def @@ -59,9 +59,18 @@ use_cavity_partial_cell=.false. use_floatice = .false. use_sw_pene=.true. flag_debug=.false. +use_transit=.false. / &machine n_levels=2 n_part= 12, 36 ! 432 number of partitions on each hierarchy level / + +&icebergs +use_icesheet_coupling=.false. +ib_num=1 +use_icebergs=.false. +steps_per_ib_step=8 +ib_async_mode=0 +/ diff --git a/config/bin_2p1z1d/namelist.forcing b/config/bin_2p1z1d/namelist.forcing index a17799393..d890c69ec 100644 --- a/config/bin_2p1z1d/namelist.forcing +++ b/config/bin_2p1z1d/namelist.forcing @@ -23,11 +23,23 @@ ncar_bulk_z_shum=10.0 ! height at which humi forcing is located (CORE, JRA-do: 1 use_landice_water=.false. landice_start_mon=5 landice_end_mon=10 +fwf_path='./mesh/' + +/ + +&age_tracer +use_age_tracer=.false. +use_age_mask=.false. +age_tracer_path='./mesh/' +age_start_year=2000 + / &nam_sbc nm_xwind_file = '/albedo/work/projects/MarESys/FROM-OLLIE/forcing_JRA55-do-v1.4.0_clim61/uas.clim61' ! name of file with winds, if nm_sbc=2 nm_ywind_file = '/albedo/work/projects/MarESys/FROM-OLLIE/forcing_JRA55-do-v1.4.0_clim61/vas.clim61' ! name of file with winds, if nm_sbc=2 + nm_xstre_file = '/albedo/work/projects/MarESys/FROM-OLLIE/forcing_JRA55-do-v1.4.0_clim61/uas.clim61' ! name of file with winds, if nm_sbc=2 + nm_ystre_file = '/albedo/work/projects/MarESys/FROM-OLLIE/forcing_JRA55-do-v1.4.0_clim61/vas.clim61' ! name of file with winds, if nm_sbc=2 nm_humi_file = '/albedo/work/projects/MarESys/FROM-OLLIE/forcing_JRA55-do-v1.4.0_clim61/huss.clim61' ! name of file with humidity nm_qsr_file = '/albedo/work/projects/MarESys/FROM-OLLIE/forcing_JRA55-do-v1.4.0_clim61/rsds.clim61' ! name of file with solar heat nm_qlw_file = '/albedo/work/projects/MarESys/FROM-OLLIE/forcing_JRA55-do-v1.4.0_clim61/rlds.clim61' ! name of file with Long wave @@ -37,24 +49,32 @@ landice_end_mon=10 nm_mslp_file = '/albedo/work/projects/MarESys/FROM-OLLIE/forcing_JRA55-do-v1.4.0_clim61/psl.clim61' ! air_pressure_at_sea_level nm_xwind_var = 'uas' ! name of variable in file with wind nm_ywind_var = 'vas' ! name of variable in file with wind - nm_humi_var = 'huss' ! name of variable in file with humidity - nm_qsr_var = 'rsds' ! name of variable in file with solar heat - nm_qlw_var = 'rlds' ! name of variable in file with Long wave + nm_xstre_var = 'uas' ! name of variable in file with wind + nm_ystre_var = 'vas' ! name of variable in file with wind + nm_humi_var = 'huss' ! name of variable in file with humidity + nm_qsr_var = 'rsds' ! name of variable in file with solar heat + nm_qlw_var = 'rlds' ! name of variable in file with Long wave nm_tair_var = 'tas' ! name of variable in file with 2m air temperature - nm_prec_var = 'prra' ! name of variable in file with total precipitation - nm_snow_var = 'prsn' ! name of variable in file with total precipitation - nm_mslp_var = 'psl' ! name of variable in file with air_pressure_at_sea_level + nm_prec_var = 'prra' ! name of variable in file with total precipitation + nm_snow_var = 'prsn' ! name of variable in file with total precipitation + nm_mslp_var = 'psl' ! name of variable in file with air_pressure_at_sea_level nm_nc_iyear = 1900 nm_nc_imm = 1 ! initial month of time axis in netCDF nm_nc_idd = 1 ! initial day of time axis in netCDF nm_nc_freq = 1 ! data points per day (i.e. 86400 if the time axis is in seconds) nm_nc_tmid = 0 ! 1 if the time stamps are given at the mid points of the netcdf file, 0 otherwise (i.e. 1 in CORE1, CORE2; 0 in JRA55) y_perpetual=.true. - l_xwind=.true. l_ywind=.true. l_humi=.true. l_qsr=.true. l_qlw=.true. l_tair=.true. l_prec=.true. l_mslp=.true. l_cloud=.false. l_snow=.true. + l_xwind=.true. l_ywind=.true. l_xstre=.false. l_ystre=.false. l_humi=.true. l_qsr=.true. l_qlw=.true. l_tair=.true. l_prec=.true. l_mslp=.true. l_cloud=.false. l_snow=.true. nm_runoff_file ='/albedo/pool/FESOM/forcing/CORE2/runoff.nc' runoff_data_source ='CORE2' !Dai09, CORE2 !runoff_data_source ='Dai09' !Dai09, CORE2, JRA55 !runoff_climatology =.true. - nm_sss_data_file ='/albedo/pool/FESOM/forcing/CORE2/PHC2_salx.nc' sss_data_source ='CORE2' + nm_sss_data_file ='/albedo/pool/FESOM/forcing/CORE2/PHC2_salx.nc' + chl_data_source ='None' !'Sweeney' monthly chlorophyll climatology or 'NONE' for constant chl_const (below). Make use_sw_pene=.TRUE. in namelist.config! + nm_chl_data_file ='/pool/data/AWICM/FESOM2/FORCING/JRA55-do-v1.4.0/Sweeney/Sweeney_2005.nc' + chl_const = 0.1 + use_runoff_mapper = .FALSE. + runoff_basins_file = 'runoff_maps_regular.nc' + runoff_radius = 500000. / diff --git a/config/bin_2p1z1d/namelist.icepack.cesm.ponds b/config/bin_2p1z1d/namelist.icepack.cesm.ponds new file mode 100644 index 000000000..51aa33191 --- /dev/null +++ b/config/bin_2p1z1d/namelist.icepack.cesm.ponds @@ -0,0 +1,144 @@ +&env_nml ! In the original release these variables are defined in the icepack.settings + nicecat = 5 ! number of ice thickness categories + nfsdcat = 1 ! number of floe size categories + nicelyr = 4 ! number of vertical layers in the ice + nsnwlyr = 4 ! number of vertical layers in the snow + ntraero = 0 ! number of aerosol tracers (up to max_aero in ice_domain_size.F90) + trzaero = 0 ! number of z aerosol tracers (up to max_aero = 6) + tralg = 0 ! number of algal tracers (up to max_algae = 3) + trdoc = 0 ! number of dissolve organic carbon (up to max_doc = 3) + trdic = 0 ! number of dissolve inorganic carbon (up to max_dic = 1) + trdon = 0 ! number of dissolve organic nitrogen (up to max_don = 1) + trfed = 0 ! number of dissolved iron tracers (up to max_fe = 2) + trfep = 0 ! number of particulate iron tracers (up to max_fe = 2) + nbgclyr = 0 ! number of zbgc layers + trbgcz = 0 ! set to 1 for zbgc tracers (needs TRBGCS = 0 and TRBRI = 1) + trzs = 0 ! set to 1 for zsalinity tracer (needs TRBRI = 1) + trbri = 0 ! set to 1 for brine height tracer + trage = 0 ! set to 1 for ice age tracer + trfy = 0 ! set to 1 for first-year ice area tracer + trlvl = 0 ! set to 1 for level and deformed ice tracers + trpnd = 1 ! set to 1 for melt pond tracers + trbgcs = 0 ! set to 1 for skeletal layer tracers (needs TRBGCZ = 0) + ndtd = 1 ! dynamic time steps per thermodynamic time step +/ + +&grid_nml + kcatbound = 1 +/ + +&tracer_nml + tr_iage = .false. + tr_FY = .false. + tr_lvl = .false. + tr_pond_cesm = .true. + tr_pond_topo = .false. + tr_pond_lvl = .false. + tr_aero = .false. + tr_fsd = .false. +/ + +&thermo_nml + kitd = 1 + ktherm = 1 + conduct = 'bubbly' + a_rapid_mode = 0.5e-3 + Rac_rapid_mode = 10.0 + aspect_rapid_mode = 1.0 + dSdt_slow_mode = -5.0e-8 + phi_c_slow_mode = 0.05 + phi_i_mushy = 0.85 +/ + +&shortwave_nml + shortwave = 'dEdd' + albedo_type = 'ccsm3' + albicev = 0.78 + albicei = 0.36 + albsnowv = 0.98 + albsnowi = 0.70 + ahmax = 0.3 + R_ice = 0. + R_pnd = 0. + R_snw = 1.5 + dT_mlt = 1.5 + rsnw_mlt = 1500. + kalg = 0.6 +/ + +&ponds_nml + hp1 = 0.01 + hs0 = 0. + hs1 = 0.03 + dpscale = 1.e-3 + frzpnd = 'hlid' + rfracmin = 0.15 + rfracmax = 1. + pndaspect = 0.8 +/ + +&forcing_nml + formdrag = .false. + atmbndy = 'default' + calc_strair = .true. + calc_Tsfc = .true. + highfreq = .false. + natmiter = 5 + ustar_min = 0.0005 + emissivity = 0.95 + fbot_xfer_type = 'constant' + update_ocn_f = .false. + l_mpond_fresh = .false. + tfrz_option = 'linear_salt' + oceanmixed_ice = .true. + wave_spec_type = 'none' +/ + +&dynamics_nml + kstrength = 1 + krdg_partic = 1 + krdg_redist = 1 + mu_rdg = 3 + Cf = 17. + P_star = 27000. + C_star = 20. +/ + +!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +!!!!!!!!!! Icepack output namelist !!!!!!!!!! +!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +&nml_list_icepack +io_list_icepack = 'aicen ',1, 'm', 4, ! Sea ice concentration + 'vicen ',1, 'm', 4, ! Volume per unit area of ice + 'vsnon ',1, 'm', 4, ! Volume per unit area of snow + !'Tsfcn ',1, 'm', 4, ! Sea ice surf. temperature + !'iagen ',1, 'm', 4, ! Sea ice age + !'FYn ',1, 'm', 4, ! First year ice + !'lvln ',1, 'm', 4, ! Ridged sea ice area and volume + !'pond_cesmn',1, 'm', 4, ! Melt ponds area, volume and refrozen lid thickness + !'pond_topon',1, 'm', 4, ! Melt ponds area, volume and refrozen lid thickness + !'pond_lvln ',1, 'm', 4, ! Melt ponds area, volume and refrozen lid thickness + !'brinen ',1, 'm', 4, ! Volume fraction of ice with dynamic salt + !'qicen ',1, 'm', 4, ! Sea ice enthalpy + !'sicen ',1, 'm', 4, ! Sea ice salinity + !'qsnon ',1, 'm', 4, ! Snow enthalpy + ! Average over thicknes classes + !'aice ',1, 'm', 4, ! Sea ice concentration + !'vice ',1, 'm', 4, ! Volume per unit area of ice + !'vsno ',1, 'm', 4, ! Volume per unit area of snow + !'Tsfc ',1, 'm', 4, ! Sea ice surf. temperature + !'iage ',1, 'm', 4, ! Sea ice age + !'FY ',1, 'm', 4, ! First year ice + !'lvl ',1, 'm', 4, ! Ridged sea ice area and volume + !'pond_cesm ',1, 'm', 4, ! Melt ponds area, volume and refrozen lid thickness + !'pond_topo ',1, 'm', 4, ! Melt ponds area, volume and refrozen lid thickness + !'pond_lvl ',1, 'm', 4, ! Melt ponds area, volume and refrozen lid thickness + !'brine ',1, 'm', 4, ! Volume fraction of ice with dynamic salt + !'qice ',1, 'm', 4, ! Sea ice enthalpy + !'sice ',1, 'm', 4, ! Sea ice salinity + !'qsno ',1, 'm', 4, ! Snow enthalpy + ! Other variables + !'uvel ',1, 'm', 4, ! x-component of sea ice velocity + !'vvel ',1, 'm', 4, ! y-component of sea ice velocity +/ diff --git a/config/bin_2p1z1d/namelist.io b/config/bin_2p1z1d/namelist.io index 7a6fe3cff..990c90c2f 100644 --- a/config/bin_2p1z1d/namelist.io +++ b/config/bin_2p1z1d/namelist.io @@ -12,7 +12,7 @@ ldiag_extflds =.false. / &nml_general -io_listsize =100 !number of streams to allocate. shallbe large or equal to the number of streams in &nml_list +io_listsize =150 !number of streams to allocate. shallbe large or equal to the number of streams in &nml_list vec_autorotate =.false. / @@ -40,11 +40,11 @@ io_list = 'sst ',1, 'm', 4, 'otracers ',1, 'm', 4, 'N2 ',1, 'y', 4, 'Kv ',1, 'y', 4, - 'u ',1, 'y', 4, - 'v ',1, 'y', 4, - 'unod ',1, 'y', 4, - 'vnod ',1, 'y', 4, - 'w ',1, 'y', 4, + 'u ',1, 'm', 4, + 'v ',1, 'm', 4, + 'unod ',1, 'm', 4, + 'vnod ',1, 'm', 4, + 'w ',1, 'm', 4, 'Av ',1, 'y', 4, 'bolus_u ',1, 'y', 4, 'bolus_v ',1, 'y', 4, diff --git a/config/bin_2p1z1d/namelist.recom b/config/bin_2p1z1d/namelist.recom index dd53c8538..351356467 100644 --- a/config/bin_2p1z1d/namelist.recom +++ b/config/bin_2p1z1d/namelist.recom @@ -49,7 +49,7 @@ useErosion = .false. NitrogenSS = .false. ! When set to true, external sources and sinks of nitrogen are activated (Riverine, aeolian and denitrification) useAeolianN = .false. ! When set to true, aeolian nitrogen deposition is activated firstyearoffesomcycle = 1958 ! The first year of the actual physical forcing (e.g. JRA-55) used -lastyearoffesomcycle = 2022 ! Last year of the actual physical forcing used +lastyearoffesomcycle = 2024 ! Last year of the actual physical forcing used numofCO2cycles = 1 ! Number of cycles of the forcing planned currentCO2cycle = 1 ! Which CO2 cycle we are currently running DIC_PI = .true. diff --git a/config/bin_2p3z2d/job_albedo b/config/bin_2p3z2d/job_albedo index 5f3c516e7..341bdb6da 100755 --- a/config/bin_2p3z2d/job_albedo +++ b/config/bin_2p3z2d/job_albedo @@ -1,16 +1,15 @@ #!/bin/bash -#SBATCH --account=nwg_hauck.maresys # edit your account -#SBATCH --job-name=recom +#SBATCH --account=nwg_maresys.maresys +#SBATCH --job-name=2p3z2d #SBATCH --partition=mpp -#SBATCH --time=01:30:00 -####SBATCH --constraint="[rack1|rack3]" +#SBATCH -N 9 +#SBATCH --cpus-per-task=1 +#SBATCH --time=08:00:00 #SBATCH --qos=12h -#SBATCH --nodes=9 # Number of tasks (MPI) tasks to be launched -#SBATCH --tasks-per-node 96 #8 #4 # using all 128CPus we exceed the maxload limit (>130) of many used nodes when us parallel I/O -#SBATCH --cpus-per-task 1 +#SBATCH --tasks-per-node 96 # using all 128CPus we exceed the maxload limit (>130) of many used nodes when us parallel I/O -#SBATCH -o fesom2o.out -#SBATCH -e fesom2e.out +#SBATCH -o slurm-out.out +#SBATCH -e slurm-err.out # disable hyperthreading #SBATCH --hint=nomultithread @@ -24,34 +23,32 @@ ulimit -s unlimited JOBID=`echo $SLURM_JOB_ID |cut -d"." -f1` ln -s ../bin/fesom.x . # cp -n ../bin/fesom.x -cp -n ../config/namelist.config . -cp -n ../config/namelist.forcing . -cp -n ../config/namelist.oce . -cp -n ../config/namelist.dyn . -cp -n ../config/namelist.tra . -cp -n ../config/namelist.ice . -cp -n ../config/namelist.io . -cp -n ../config/namelist.icepack . +#cp -n ../config/namelist.config . +#cp -n ../config/namelist.forcing . +#cp -n ../config/namelist.oce . +#cp -n ../config/namelist.dyn . +#cp -n ../config/namelist.tra . +#cp -n ../config/namelist.ice . +#cp -n ../config/namelist.io . +#cp -n ../config/namelist.icepack . #___DETERMINE SLURM JOBID+OUTPUTFILE____________________________________________ jobid=$(echo $SLURM_JOB_ID | cut -d"." -f1) -fname="fesom2_${SLURM_JOB_NAME}_${jobid}.out" +fname="fesom2.0.out" #___PUT JOB IN QUEUE____________________________________________________________ date -####srun --mpi=pmi2 ./fesom.x >> ${fname} srun --mpi=pmi2 ./fesom.x > fesom2.0.out date #qstat -f $PBS_JOBID #export EXITSTATUS=$? #if [ ${EXITSTATUS} -eq 0 ] || [ ${EXITSTATUS} -eq 127 ] ; then -#sbatch job_ollie +#sbatch job_albedo #fi -#Resultpath='/albedo/scratch/user/ogurses/ocean_only/' -Resultpath='/albedo/scratch/user/ogurses/fesom2.5_recom_st1_vsink_vben_diags_3Zoo2Det_v3/' -test -d $Resultpath/fesom.2019.oce.restart && exit +Resultpath='/albedo/work/user/...' +test -e $Resultpath/fesom.2019.oce.restart && exit IsInFile=$( tail -3 fesom2.0.out | grep -c timesteps) if (( IsInFile > 0 )); then diff --git a/config/bin_2p3z2d/namelist.config b/config/bin_2p3z2d/namelist.config index 25c5e4a31..ffff081c0 100644 --- a/config/bin_2p3z2d/namelist.config +++ b/config/bin_2p3z2d/namelist.config @@ -6,8 +6,8 @@ runid='fesom' ×tep step_per_day=32 !96 !96 !72 !72 !45 !72 !96 -run_length=1 !62 !62 !62 !28 -run_length_unit='y' ! y, m, d, s +run_length= 1 !62 !62 !62 !28 +run_length_unit='y' ! y, m, d, s / &clockinit ! the model starts at @@ -18,8 +18,8 @@ yearnew=1958 &paths MeshPath='/albedo/work/projects/p_recompdaf/frbunsen/FESOM2/meshes/core2/' -ClimateDataPath='/albedo/work/projects/MarESys/ogurses/input/corrected_input/' -ResultPath='/albedo/scratch/user/ogurses/fesom2.5_recom_st1_vsink_vben_diags_3Zoo2Det_v3/' +ClimateDataPath='/albedo/work/projects/MarESys/ogurses/input/corrected_input/' +ResultPath='/albedo/work/user/...' / &restart_log @@ -29,7 +29,7 @@ raw_restart_length=1 ! --> do core dump restart raw_restart_length_unit='off' ! e.g. y, d, h, s, off bin_restart_length=1 ! --> do derived type binary restart bin_restart_length_unit='off' ! e.g. y, d, h, s, off -logfile_outfreq=960 !in logfile info. output frequency, # steps +logfile_outfreq=960 !in logfile info. output frequency, # steps / &ale_def @@ -59,9 +59,18 @@ use_cavity_partial_cell=.false. use_floatice = .false. use_sw_pene=.true. flag_debug=.false. +use_transit=.false. / &machine n_levels=2 n_part= 12, 36 ! 432 number of partitions on each hierarchy level / + +&icebergs +use_icesheet_coupling=.false. +ib_num=1 +use_icebergs=.false. +steps_per_ib_step=8 +ib_async_mode=0 +/ diff --git a/config/bin_2p3z2d/namelist.forcing b/config/bin_2p3z2d/namelist.forcing index a17799393..d890c69ec 100644 --- a/config/bin_2p3z2d/namelist.forcing +++ b/config/bin_2p3z2d/namelist.forcing @@ -23,11 +23,23 @@ ncar_bulk_z_shum=10.0 ! height at which humi forcing is located (CORE, JRA-do: 1 use_landice_water=.false. landice_start_mon=5 landice_end_mon=10 +fwf_path='./mesh/' + +/ + +&age_tracer +use_age_tracer=.false. +use_age_mask=.false. +age_tracer_path='./mesh/' +age_start_year=2000 + / &nam_sbc nm_xwind_file = '/albedo/work/projects/MarESys/FROM-OLLIE/forcing_JRA55-do-v1.4.0_clim61/uas.clim61' ! name of file with winds, if nm_sbc=2 nm_ywind_file = '/albedo/work/projects/MarESys/FROM-OLLIE/forcing_JRA55-do-v1.4.0_clim61/vas.clim61' ! name of file with winds, if nm_sbc=2 + nm_xstre_file = '/albedo/work/projects/MarESys/FROM-OLLIE/forcing_JRA55-do-v1.4.0_clim61/uas.clim61' ! name of file with winds, if nm_sbc=2 + nm_ystre_file = '/albedo/work/projects/MarESys/FROM-OLLIE/forcing_JRA55-do-v1.4.0_clim61/vas.clim61' ! name of file with winds, if nm_sbc=2 nm_humi_file = '/albedo/work/projects/MarESys/FROM-OLLIE/forcing_JRA55-do-v1.4.0_clim61/huss.clim61' ! name of file with humidity nm_qsr_file = '/albedo/work/projects/MarESys/FROM-OLLIE/forcing_JRA55-do-v1.4.0_clim61/rsds.clim61' ! name of file with solar heat nm_qlw_file = '/albedo/work/projects/MarESys/FROM-OLLIE/forcing_JRA55-do-v1.4.0_clim61/rlds.clim61' ! name of file with Long wave @@ -37,24 +49,32 @@ landice_end_mon=10 nm_mslp_file = '/albedo/work/projects/MarESys/FROM-OLLIE/forcing_JRA55-do-v1.4.0_clim61/psl.clim61' ! air_pressure_at_sea_level nm_xwind_var = 'uas' ! name of variable in file with wind nm_ywind_var = 'vas' ! name of variable in file with wind - nm_humi_var = 'huss' ! name of variable in file with humidity - nm_qsr_var = 'rsds' ! name of variable in file with solar heat - nm_qlw_var = 'rlds' ! name of variable in file with Long wave + nm_xstre_var = 'uas' ! name of variable in file with wind + nm_ystre_var = 'vas' ! name of variable in file with wind + nm_humi_var = 'huss' ! name of variable in file with humidity + nm_qsr_var = 'rsds' ! name of variable in file with solar heat + nm_qlw_var = 'rlds' ! name of variable in file with Long wave nm_tair_var = 'tas' ! name of variable in file with 2m air temperature - nm_prec_var = 'prra' ! name of variable in file with total precipitation - nm_snow_var = 'prsn' ! name of variable in file with total precipitation - nm_mslp_var = 'psl' ! name of variable in file with air_pressure_at_sea_level + nm_prec_var = 'prra' ! name of variable in file with total precipitation + nm_snow_var = 'prsn' ! name of variable in file with total precipitation + nm_mslp_var = 'psl' ! name of variable in file with air_pressure_at_sea_level nm_nc_iyear = 1900 nm_nc_imm = 1 ! initial month of time axis in netCDF nm_nc_idd = 1 ! initial day of time axis in netCDF nm_nc_freq = 1 ! data points per day (i.e. 86400 if the time axis is in seconds) nm_nc_tmid = 0 ! 1 if the time stamps are given at the mid points of the netcdf file, 0 otherwise (i.e. 1 in CORE1, CORE2; 0 in JRA55) y_perpetual=.true. - l_xwind=.true. l_ywind=.true. l_humi=.true. l_qsr=.true. l_qlw=.true. l_tair=.true. l_prec=.true. l_mslp=.true. l_cloud=.false. l_snow=.true. + l_xwind=.true. l_ywind=.true. l_xstre=.false. l_ystre=.false. l_humi=.true. l_qsr=.true. l_qlw=.true. l_tair=.true. l_prec=.true. l_mslp=.true. l_cloud=.false. l_snow=.true. nm_runoff_file ='/albedo/pool/FESOM/forcing/CORE2/runoff.nc' runoff_data_source ='CORE2' !Dai09, CORE2 !runoff_data_source ='Dai09' !Dai09, CORE2, JRA55 !runoff_climatology =.true. - nm_sss_data_file ='/albedo/pool/FESOM/forcing/CORE2/PHC2_salx.nc' sss_data_source ='CORE2' + nm_sss_data_file ='/albedo/pool/FESOM/forcing/CORE2/PHC2_salx.nc' + chl_data_source ='None' !'Sweeney' monthly chlorophyll climatology or 'NONE' for constant chl_const (below). Make use_sw_pene=.TRUE. in namelist.config! + nm_chl_data_file ='/pool/data/AWICM/FESOM2/FORCING/JRA55-do-v1.4.0/Sweeney/Sweeney_2005.nc' + chl_const = 0.1 + use_runoff_mapper = .FALSE. + runoff_basins_file = 'runoff_maps_regular.nc' + runoff_radius = 500000. / diff --git a/config/bin_2p3z2d/namelist.icepack.cesm.ponds b/config/bin_2p3z2d/namelist.icepack.cesm.ponds new file mode 100644 index 000000000..51aa33191 --- /dev/null +++ b/config/bin_2p3z2d/namelist.icepack.cesm.ponds @@ -0,0 +1,144 @@ +&env_nml ! In the original release these variables are defined in the icepack.settings + nicecat = 5 ! number of ice thickness categories + nfsdcat = 1 ! number of floe size categories + nicelyr = 4 ! number of vertical layers in the ice + nsnwlyr = 4 ! number of vertical layers in the snow + ntraero = 0 ! number of aerosol tracers (up to max_aero in ice_domain_size.F90) + trzaero = 0 ! number of z aerosol tracers (up to max_aero = 6) + tralg = 0 ! number of algal tracers (up to max_algae = 3) + trdoc = 0 ! number of dissolve organic carbon (up to max_doc = 3) + trdic = 0 ! number of dissolve inorganic carbon (up to max_dic = 1) + trdon = 0 ! number of dissolve organic nitrogen (up to max_don = 1) + trfed = 0 ! number of dissolved iron tracers (up to max_fe = 2) + trfep = 0 ! number of particulate iron tracers (up to max_fe = 2) + nbgclyr = 0 ! number of zbgc layers + trbgcz = 0 ! set to 1 for zbgc tracers (needs TRBGCS = 0 and TRBRI = 1) + trzs = 0 ! set to 1 for zsalinity tracer (needs TRBRI = 1) + trbri = 0 ! set to 1 for brine height tracer + trage = 0 ! set to 1 for ice age tracer + trfy = 0 ! set to 1 for first-year ice area tracer + trlvl = 0 ! set to 1 for level and deformed ice tracers + trpnd = 1 ! set to 1 for melt pond tracers + trbgcs = 0 ! set to 1 for skeletal layer tracers (needs TRBGCZ = 0) + ndtd = 1 ! dynamic time steps per thermodynamic time step +/ + +&grid_nml + kcatbound = 1 +/ + +&tracer_nml + tr_iage = .false. + tr_FY = .false. + tr_lvl = .false. + tr_pond_cesm = .true. + tr_pond_topo = .false. + tr_pond_lvl = .false. + tr_aero = .false. + tr_fsd = .false. +/ + +&thermo_nml + kitd = 1 + ktherm = 1 + conduct = 'bubbly' + a_rapid_mode = 0.5e-3 + Rac_rapid_mode = 10.0 + aspect_rapid_mode = 1.0 + dSdt_slow_mode = -5.0e-8 + phi_c_slow_mode = 0.05 + phi_i_mushy = 0.85 +/ + +&shortwave_nml + shortwave = 'dEdd' + albedo_type = 'ccsm3' + albicev = 0.78 + albicei = 0.36 + albsnowv = 0.98 + albsnowi = 0.70 + ahmax = 0.3 + R_ice = 0. + R_pnd = 0. + R_snw = 1.5 + dT_mlt = 1.5 + rsnw_mlt = 1500. + kalg = 0.6 +/ + +&ponds_nml + hp1 = 0.01 + hs0 = 0. + hs1 = 0.03 + dpscale = 1.e-3 + frzpnd = 'hlid' + rfracmin = 0.15 + rfracmax = 1. + pndaspect = 0.8 +/ + +&forcing_nml + formdrag = .false. + atmbndy = 'default' + calc_strair = .true. + calc_Tsfc = .true. + highfreq = .false. + natmiter = 5 + ustar_min = 0.0005 + emissivity = 0.95 + fbot_xfer_type = 'constant' + update_ocn_f = .false. + l_mpond_fresh = .false. + tfrz_option = 'linear_salt' + oceanmixed_ice = .true. + wave_spec_type = 'none' +/ + +&dynamics_nml + kstrength = 1 + krdg_partic = 1 + krdg_redist = 1 + mu_rdg = 3 + Cf = 17. + P_star = 27000. + C_star = 20. +/ + +!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +!!!!!!!!!! Icepack output namelist !!!!!!!!!! +!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +&nml_list_icepack +io_list_icepack = 'aicen ',1, 'm', 4, ! Sea ice concentration + 'vicen ',1, 'm', 4, ! Volume per unit area of ice + 'vsnon ',1, 'm', 4, ! Volume per unit area of snow + !'Tsfcn ',1, 'm', 4, ! Sea ice surf. temperature + !'iagen ',1, 'm', 4, ! Sea ice age + !'FYn ',1, 'm', 4, ! First year ice + !'lvln ',1, 'm', 4, ! Ridged sea ice area and volume + !'pond_cesmn',1, 'm', 4, ! Melt ponds area, volume and refrozen lid thickness + !'pond_topon',1, 'm', 4, ! Melt ponds area, volume and refrozen lid thickness + !'pond_lvln ',1, 'm', 4, ! Melt ponds area, volume and refrozen lid thickness + !'brinen ',1, 'm', 4, ! Volume fraction of ice with dynamic salt + !'qicen ',1, 'm', 4, ! Sea ice enthalpy + !'sicen ',1, 'm', 4, ! Sea ice salinity + !'qsnon ',1, 'm', 4, ! Snow enthalpy + ! Average over thicknes classes + !'aice ',1, 'm', 4, ! Sea ice concentration + !'vice ',1, 'm', 4, ! Volume per unit area of ice + !'vsno ',1, 'm', 4, ! Volume per unit area of snow + !'Tsfc ',1, 'm', 4, ! Sea ice surf. temperature + !'iage ',1, 'm', 4, ! Sea ice age + !'FY ',1, 'm', 4, ! First year ice + !'lvl ',1, 'm', 4, ! Ridged sea ice area and volume + !'pond_cesm ',1, 'm', 4, ! Melt ponds area, volume and refrozen lid thickness + !'pond_topo ',1, 'm', 4, ! Melt ponds area, volume and refrozen lid thickness + !'pond_lvl ',1, 'm', 4, ! Melt ponds area, volume and refrozen lid thickness + !'brine ',1, 'm', 4, ! Volume fraction of ice with dynamic salt + !'qice ',1, 'm', 4, ! Sea ice enthalpy + !'sice ',1, 'm', 4, ! Sea ice salinity + !'qsno ',1, 'm', 4, ! Snow enthalpy + ! Other variables + !'uvel ',1, 'm', 4, ! x-component of sea ice velocity + !'vvel ',1, 'm', 4, ! y-component of sea ice velocity +/ diff --git a/config/bin_2p3z2d/namelist.io b/config/bin_2p3z2d/namelist.io index 01bcab49f..10bb72c1b 100644 --- a/config/bin_2p3z2d/namelist.io +++ b/config/bin_2p3z2d/namelist.io @@ -12,7 +12,7 @@ ldiag_extflds =.false. / &nml_general -io_listsize =100 !number of streams to allocate. shallbe large or equal to the number of streams in &nml_list +io_listsize =150 !number of streams to allocate. shallbe large or equal to the number of streams in &nml_list vec_autorotate =.false. / @@ -40,11 +40,11 @@ io_list = 'sst ',1, 'm', 4, 'otracers ',1, 'm', 4, 'N2 ',1, 'y', 4, 'Kv ',1, 'y', 4, - 'u ',1, 'y', 4, - 'v ',1, 'y', 4, - 'unod ',1, 'y', 4, - 'vnod ',1, 'y', 4, - 'w ',1, 'y', 4, + 'u ',1, 'm', 4, + 'v ',1, 'm', 4, + 'unod ',1, 'm', 4, + 'vnod ',1, 'm', 4, + 'w ',1, 'm', 4, 'Av ',1, 'y', 4, 'bolus_u ',1, 'y', 4, 'bolus_v ',1, 'y', 4, diff --git a/config/bin_2p3z2d/namelist.recom b/config/bin_2p3z2d/namelist.recom index 24145b956..5d18e9295 100644 --- a/config/bin_2p3z2d/namelist.recom +++ b/config/bin_2p3z2d/namelist.recom @@ -49,7 +49,7 @@ useErosion = .false. NitrogenSS = .false. ! When set to true, external sources and sinks of nitrogen are activated (Riverine, aeolian and denitrification) useAeolianN = .false. ! When set to true, aeolian nitrogen deposition is activated firstyearoffesomcycle = 1958 ! The first year of the actual physical forcing (e.g. JRA-55) used -lastyearoffesomcycle = 2022 ! Last year of the actual physical forcing used +lastyearoffesomcycle = 2024 ! Last year of the actual physical forcing used numofCO2cycles = 1 ! Number of cycles of the forcing planned currentCO2cycle = 1 ! Which CO2 cycle we are currently running DIC_PI = .true. diff --git a/config/bin_3p3z2d/job_albedo b/config/bin_3p3z2d/job_albedo index 9eff795cb..510603cff 100755 --- a/config/bin_3p3z2d/job_albedo +++ b/config/bin_3p3z2d/job_albedo @@ -1,16 +1,15 @@ #!/bin/bash -#SBATCH --account=nwg_hauck.maresys # edit your account -#SBATCH --job-name=recom +#SBATCH --account=nwg_maresys.maresys +#SBATCH --job-name=3p3z2d #SBATCH --partition=mpp -#SBATCH --time=01:30:00 -####SBATCH --constraint="[rack1|rack3]" +#SBATCH -N 9 +#SBATCH --cpus-per-task=1 +#SBATCH --time=08:00:00 #SBATCH --qos=12h -#SBATCH --nodes=9 # Number of tasks (MPI) tasks to be launched -#SBATCH --tasks-per-node 96 #8 #4 # using all 128CPus we exceed the maxload limit (>130) of many used nodes when us parallel I/O -#SBATCH --cpus-per-task 1 +#SBATCH --tasks-per-node 96 # using all 128CPus we exceed the maxload limit (>130) of many used nodes when us parallel I/O -#SBATCH -o fesom2o.out -#SBATCH -e fesom2e.out +#SBATCH -o slurm-out.out +#SBATCH -e slurm-err.out # disable hyperthreading #SBATCH --hint=nomultithread @@ -24,34 +23,32 @@ ulimit -s unlimited JOBID=`echo $SLURM_JOB_ID |cut -d"." -f1` ln -s ../bin/fesom.x . # cp -n ../bin/fesom.x -cp -n ../config/namelist.config . -cp -n ../config/namelist.forcing . -cp -n ../config/namelist.oce . -cp -n ../config/namelist.dyn . -cp -n ../config/namelist.tra . -cp -n ../config/namelist.ice . -cp -n ../config/namelist.io . -cp -n ../config/namelist.icepack . +#cp -n ../config/namelist.config . +#cp -n ../config/namelist.forcing . +#cp -n ../config/namelist.oce . +#cp -n ../config/namelist.dyn . +#cp -n ../config/namelist.tra . +#cp -n ../config/namelist.ice . +#cp -n ../config/namelist.io . +#cp -n ../config/namelist.icepack . #___DETERMINE SLURM JOBID+OUTPUTFILE____________________________________________ jobid=$(echo $SLURM_JOB_ID | cut -d"." -f1) -fname="fesom2_${SLURM_JOB_NAME}_${jobid}.out" +fname="fesom2.0.out" #___PUT JOB IN QUEUE____________________________________________________________ date -####srun --mpi=pmi2 ./fesom.x >> ${fname} srun --mpi=pmi2 ./fesom.x > fesom2.0.out date #qstat -f $PBS_JOBID #export EXITSTATUS=$? #if [ ${EXITSTATUS} -eq 0 ] || [ ${EXITSTATUS} -eq 127 ] ; then -#sbatch job_ollie +#sbatch job_albedo #fi -#Resultpath='/albedo/scratch/user/ogurses/ocean_only/' -Resultpath='/albedo/scratch/user/ogurses/fesom2.5_recom_st1_vsink_vben_diags_3Zoo2Det_coccos/' -test -d $Resultpath/fesom.2019.oce.restart && exit +Resultpath='/albedo/work/user/...' +test -e $Resultpath/fesom.2019.oce.restart && exit IsInFile=$( tail -3 fesom2.0.out | grep -c timesteps) if (( IsInFile > 0 )); then diff --git a/config/bin_3p3z2d/namelist.config b/config/bin_3p3z2d/namelist.config index 9a048d633..ffff081c0 100644 --- a/config/bin_3p3z2d/namelist.config +++ b/config/bin_3p3z2d/namelist.config @@ -6,8 +6,8 @@ runid='fesom' ×tep step_per_day=32 !96 !96 !72 !72 !45 !72 !96 -run_length=1 !62 !62 !62 !28 -run_length_unit='y' ! y, m, d, s +run_length= 1 !62 !62 !62 !28 +run_length_unit='y' ! y, m, d, s / &clockinit ! the model starts at @@ -18,8 +18,8 @@ yearnew=1958 &paths MeshPath='/albedo/work/projects/p_recompdaf/frbunsen/FESOM2/meshes/core2/' -ClimateDataPath='/albedo/work/projects/MarESys/ogurses/input/corrected_input/' -ResultPath='/albedo/scratch/user/ogurses/fesom2.5_recom_st1_vsink_vben_diags_3Zoo2Det_coccos/' +ClimateDataPath='/albedo/work/projects/MarESys/ogurses/input/corrected_input/' +ResultPath='/albedo/work/user/...' / &restart_log @@ -29,7 +29,7 @@ raw_restart_length=1 ! --> do core dump restart raw_restart_length_unit='off' ! e.g. y, d, h, s, off bin_restart_length=1 ! --> do derived type binary restart bin_restart_length_unit='off' ! e.g. y, d, h, s, off -logfile_outfreq=960 !in logfile info. output frequency, # steps +logfile_outfreq=960 !in logfile info. output frequency, # steps / &ale_def @@ -59,9 +59,18 @@ use_cavity_partial_cell=.false. use_floatice = .false. use_sw_pene=.true. flag_debug=.false. +use_transit=.false. / &machine n_levels=2 n_part= 12, 36 ! 432 number of partitions on each hierarchy level / + +&icebergs +use_icesheet_coupling=.false. +ib_num=1 +use_icebergs=.false. +steps_per_ib_step=8 +ib_async_mode=0 +/ diff --git a/config/bin_3p3z2d/namelist.forcing b/config/bin_3p3z2d/namelist.forcing index a17799393..d890c69ec 100644 --- a/config/bin_3p3z2d/namelist.forcing +++ b/config/bin_3p3z2d/namelist.forcing @@ -23,11 +23,23 @@ ncar_bulk_z_shum=10.0 ! height at which humi forcing is located (CORE, JRA-do: 1 use_landice_water=.false. landice_start_mon=5 landice_end_mon=10 +fwf_path='./mesh/' + +/ + +&age_tracer +use_age_tracer=.false. +use_age_mask=.false. +age_tracer_path='./mesh/' +age_start_year=2000 + / &nam_sbc nm_xwind_file = '/albedo/work/projects/MarESys/FROM-OLLIE/forcing_JRA55-do-v1.4.0_clim61/uas.clim61' ! name of file with winds, if nm_sbc=2 nm_ywind_file = '/albedo/work/projects/MarESys/FROM-OLLIE/forcing_JRA55-do-v1.4.0_clim61/vas.clim61' ! name of file with winds, if nm_sbc=2 + nm_xstre_file = '/albedo/work/projects/MarESys/FROM-OLLIE/forcing_JRA55-do-v1.4.0_clim61/uas.clim61' ! name of file with winds, if nm_sbc=2 + nm_ystre_file = '/albedo/work/projects/MarESys/FROM-OLLIE/forcing_JRA55-do-v1.4.0_clim61/vas.clim61' ! name of file with winds, if nm_sbc=2 nm_humi_file = '/albedo/work/projects/MarESys/FROM-OLLIE/forcing_JRA55-do-v1.4.0_clim61/huss.clim61' ! name of file with humidity nm_qsr_file = '/albedo/work/projects/MarESys/FROM-OLLIE/forcing_JRA55-do-v1.4.0_clim61/rsds.clim61' ! name of file with solar heat nm_qlw_file = '/albedo/work/projects/MarESys/FROM-OLLIE/forcing_JRA55-do-v1.4.0_clim61/rlds.clim61' ! name of file with Long wave @@ -37,24 +49,32 @@ landice_end_mon=10 nm_mslp_file = '/albedo/work/projects/MarESys/FROM-OLLIE/forcing_JRA55-do-v1.4.0_clim61/psl.clim61' ! air_pressure_at_sea_level nm_xwind_var = 'uas' ! name of variable in file with wind nm_ywind_var = 'vas' ! name of variable in file with wind - nm_humi_var = 'huss' ! name of variable in file with humidity - nm_qsr_var = 'rsds' ! name of variable in file with solar heat - nm_qlw_var = 'rlds' ! name of variable in file with Long wave + nm_xstre_var = 'uas' ! name of variable in file with wind + nm_ystre_var = 'vas' ! name of variable in file with wind + nm_humi_var = 'huss' ! name of variable in file with humidity + nm_qsr_var = 'rsds' ! name of variable in file with solar heat + nm_qlw_var = 'rlds' ! name of variable in file with Long wave nm_tair_var = 'tas' ! name of variable in file with 2m air temperature - nm_prec_var = 'prra' ! name of variable in file with total precipitation - nm_snow_var = 'prsn' ! name of variable in file with total precipitation - nm_mslp_var = 'psl' ! name of variable in file with air_pressure_at_sea_level + nm_prec_var = 'prra' ! name of variable in file with total precipitation + nm_snow_var = 'prsn' ! name of variable in file with total precipitation + nm_mslp_var = 'psl' ! name of variable in file with air_pressure_at_sea_level nm_nc_iyear = 1900 nm_nc_imm = 1 ! initial month of time axis in netCDF nm_nc_idd = 1 ! initial day of time axis in netCDF nm_nc_freq = 1 ! data points per day (i.e. 86400 if the time axis is in seconds) nm_nc_tmid = 0 ! 1 if the time stamps are given at the mid points of the netcdf file, 0 otherwise (i.e. 1 in CORE1, CORE2; 0 in JRA55) y_perpetual=.true. - l_xwind=.true. l_ywind=.true. l_humi=.true. l_qsr=.true. l_qlw=.true. l_tair=.true. l_prec=.true. l_mslp=.true. l_cloud=.false. l_snow=.true. + l_xwind=.true. l_ywind=.true. l_xstre=.false. l_ystre=.false. l_humi=.true. l_qsr=.true. l_qlw=.true. l_tair=.true. l_prec=.true. l_mslp=.true. l_cloud=.false. l_snow=.true. nm_runoff_file ='/albedo/pool/FESOM/forcing/CORE2/runoff.nc' runoff_data_source ='CORE2' !Dai09, CORE2 !runoff_data_source ='Dai09' !Dai09, CORE2, JRA55 !runoff_climatology =.true. - nm_sss_data_file ='/albedo/pool/FESOM/forcing/CORE2/PHC2_salx.nc' sss_data_source ='CORE2' + nm_sss_data_file ='/albedo/pool/FESOM/forcing/CORE2/PHC2_salx.nc' + chl_data_source ='None' !'Sweeney' monthly chlorophyll climatology or 'NONE' for constant chl_const (below). Make use_sw_pene=.TRUE. in namelist.config! + nm_chl_data_file ='/pool/data/AWICM/FESOM2/FORCING/JRA55-do-v1.4.0/Sweeney/Sweeney_2005.nc' + chl_const = 0.1 + use_runoff_mapper = .FALSE. + runoff_basins_file = 'runoff_maps_regular.nc' + runoff_radius = 500000. / diff --git a/config/bin_3p3z2d/namelist.icepack.cesm.ponds b/config/bin_3p3z2d/namelist.icepack.cesm.ponds new file mode 100644 index 000000000..51aa33191 --- /dev/null +++ b/config/bin_3p3z2d/namelist.icepack.cesm.ponds @@ -0,0 +1,144 @@ +&env_nml ! In the original release these variables are defined in the icepack.settings + nicecat = 5 ! number of ice thickness categories + nfsdcat = 1 ! number of floe size categories + nicelyr = 4 ! number of vertical layers in the ice + nsnwlyr = 4 ! number of vertical layers in the snow + ntraero = 0 ! number of aerosol tracers (up to max_aero in ice_domain_size.F90) + trzaero = 0 ! number of z aerosol tracers (up to max_aero = 6) + tralg = 0 ! number of algal tracers (up to max_algae = 3) + trdoc = 0 ! number of dissolve organic carbon (up to max_doc = 3) + trdic = 0 ! number of dissolve inorganic carbon (up to max_dic = 1) + trdon = 0 ! number of dissolve organic nitrogen (up to max_don = 1) + trfed = 0 ! number of dissolved iron tracers (up to max_fe = 2) + trfep = 0 ! number of particulate iron tracers (up to max_fe = 2) + nbgclyr = 0 ! number of zbgc layers + trbgcz = 0 ! set to 1 for zbgc tracers (needs TRBGCS = 0 and TRBRI = 1) + trzs = 0 ! set to 1 for zsalinity tracer (needs TRBRI = 1) + trbri = 0 ! set to 1 for brine height tracer + trage = 0 ! set to 1 for ice age tracer + trfy = 0 ! set to 1 for first-year ice area tracer + trlvl = 0 ! set to 1 for level and deformed ice tracers + trpnd = 1 ! set to 1 for melt pond tracers + trbgcs = 0 ! set to 1 for skeletal layer tracers (needs TRBGCZ = 0) + ndtd = 1 ! dynamic time steps per thermodynamic time step +/ + +&grid_nml + kcatbound = 1 +/ + +&tracer_nml + tr_iage = .false. + tr_FY = .false. + tr_lvl = .false. + tr_pond_cesm = .true. + tr_pond_topo = .false. + tr_pond_lvl = .false. + tr_aero = .false. + tr_fsd = .false. +/ + +&thermo_nml + kitd = 1 + ktherm = 1 + conduct = 'bubbly' + a_rapid_mode = 0.5e-3 + Rac_rapid_mode = 10.0 + aspect_rapid_mode = 1.0 + dSdt_slow_mode = -5.0e-8 + phi_c_slow_mode = 0.05 + phi_i_mushy = 0.85 +/ + +&shortwave_nml + shortwave = 'dEdd' + albedo_type = 'ccsm3' + albicev = 0.78 + albicei = 0.36 + albsnowv = 0.98 + albsnowi = 0.70 + ahmax = 0.3 + R_ice = 0. + R_pnd = 0. + R_snw = 1.5 + dT_mlt = 1.5 + rsnw_mlt = 1500. + kalg = 0.6 +/ + +&ponds_nml + hp1 = 0.01 + hs0 = 0. + hs1 = 0.03 + dpscale = 1.e-3 + frzpnd = 'hlid' + rfracmin = 0.15 + rfracmax = 1. + pndaspect = 0.8 +/ + +&forcing_nml + formdrag = .false. + atmbndy = 'default' + calc_strair = .true. + calc_Tsfc = .true. + highfreq = .false. + natmiter = 5 + ustar_min = 0.0005 + emissivity = 0.95 + fbot_xfer_type = 'constant' + update_ocn_f = .false. + l_mpond_fresh = .false. + tfrz_option = 'linear_salt' + oceanmixed_ice = .true. + wave_spec_type = 'none' +/ + +&dynamics_nml + kstrength = 1 + krdg_partic = 1 + krdg_redist = 1 + mu_rdg = 3 + Cf = 17. + P_star = 27000. + C_star = 20. +/ + +!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +!!!!!!!!!! Icepack output namelist !!!!!!!!!! +!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +&nml_list_icepack +io_list_icepack = 'aicen ',1, 'm', 4, ! Sea ice concentration + 'vicen ',1, 'm', 4, ! Volume per unit area of ice + 'vsnon ',1, 'm', 4, ! Volume per unit area of snow + !'Tsfcn ',1, 'm', 4, ! Sea ice surf. temperature + !'iagen ',1, 'm', 4, ! Sea ice age + !'FYn ',1, 'm', 4, ! First year ice + !'lvln ',1, 'm', 4, ! Ridged sea ice area and volume + !'pond_cesmn',1, 'm', 4, ! Melt ponds area, volume and refrozen lid thickness + !'pond_topon',1, 'm', 4, ! Melt ponds area, volume and refrozen lid thickness + !'pond_lvln ',1, 'm', 4, ! Melt ponds area, volume and refrozen lid thickness + !'brinen ',1, 'm', 4, ! Volume fraction of ice with dynamic salt + !'qicen ',1, 'm', 4, ! Sea ice enthalpy + !'sicen ',1, 'm', 4, ! Sea ice salinity + !'qsnon ',1, 'm', 4, ! Snow enthalpy + ! Average over thicknes classes + !'aice ',1, 'm', 4, ! Sea ice concentration + !'vice ',1, 'm', 4, ! Volume per unit area of ice + !'vsno ',1, 'm', 4, ! Volume per unit area of snow + !'Tsfc ',1, 'm', 4, ! Sea ice surf. temperature + !'iage ',1, 'm', 4, ! Sea ice age + !'FY ',1, 'm', 4, ! First year ice + !'lvl ',1, 'm', 4, ! Ridged sea ice area and volume + !'pond_cesm ',1, 'm', 4, ! Melt ponds area, volume and refrozen lid thickness + !'pond_topo ',1, 'm', 4, ! Melt ponds area, volume and refrozen lid thickness + !'pond_lvl ',1, 'm', 4, ! Melt ponds area, volume and refrozen lid thickness + !'brine ',1, 'm', 4, ! Volume fraction of ice with dynamic salt + !'qice ',1, 'm', 4, ! Sea ice enthalpy + !'sice ',1, 'm', 4, ! Sea ice salinity + !'qsno ',1, 'm', 4, ! Snow enthalpy + ! Other variables + !'uvel ',1, 'm', 4, ! x-component of sea ice velocity + !'vvel ',1, 'm', 4, ! y-component of sea ice velocity +/ diff --git a/config/bin_3p3z2d/namelist.io b/config/bin_3p3z2d/namelist.io index b1d4c18e6..6da21b99b 100644 --- a/config/bin_3p3z2d/namelist.io +++ b/config/bin_3p3z2d/namelist.io @@ -12,7 +12,7 @@ ldiag_extflds =.false. / &nml_general -io_listsize =100 !number of streams to allocate. shallbe large or equal to the number of streams in &nml_list +io_listsize =150 !number of streams to allocate. shallbe large or equal to the number of streams in &nml_list vec_autorotate =.false. / @@ -55,6 +55,7 @@ io_list = 'sst ',1, 'm', 4, 'Hp ',1, 'm', 4, 'aFe ',1, 'm', 4, 'aN ',1, 'm', 4, + 'denb ',1, 'm', 4, 'benN ',1, 'm', 4, 'benC ',1, 'm', 4, 'benSi ',1, 'm', 4, diff --git a/config/bin_3p3z2d/namelist.recom b/config/bin_3p3z2d/namelist.recom index 3679e244f..6fb6dd2f8 100644 --- a/config/bin_3p3z2d/namelist.recom +++ b/config/bin_3p3z2d/namelist.recom @@ -49,7 +49,7 @@ useErosion = .false. NitrogenSS = .false. ! When set to true, external sources and sinks of nitrogen are activated (Riverine, aeolian and denitrification) useAeolianN = .false. ! When set to true, aeolian nitrogen deposition is activated firstyearoffesomcycle = 1958 ! The first year of the actual physical forcing (e.g. JRA-55) used -lastyearoffesomcycle = 2023 ! Last year of the actual physical forcing used +lastyearoffesomcycle = 2024 ! Last year of the actual physical forcing used numofCO2cycles = 1 ! Number of cycles of the forcing planned currentCO2cycle = 1 ! Which CO2 cycle we are currently running DIC_PI = .true. diff --git a/config/bin_4p3z2d/job_albedo b/config/bin_4p3z2d/job_albedo new file mode 100755 index 000000000..e6d8a8140 --- /dev/null +++ b/config/bin_4p3z2d/job_albedo @@ -0,0 +1,63 @@ +#!/bin/bash +#SBATCH --account=nwg_maresys.maresys +#SBATCH --job-name=4p3z2d +#SBATCH --partition=mpp +#SBATCH -N 9 +#SBATCH --cpus-per-task=1 +#SBATCH --time=08:00:00 +#SBATCH --qos=12h +#SBATCH --tasks-per-node 96 # using all 128CPus we exceed the maxload limit (>130) of many used nodes when us parallel I/O + +#SBATCH -o slurm-out.out +#SBATCH -e slurm-err.out + +# disable hyperthreading +#SBATCH --hint=nomultithread + +module purge +source ../env/albedo/shell +export OMP_NUM_THREADS=1 +ulimit -s unlimited + +# determine JOBID +JOBID=`echo $SLURM_JOB_ID |cut -d"." -f1` + +ln -s ../bin/fesom.x . # cp -n ../bin/fesom.x +#cp -n ../config/namelist.config . +#cp -n ../config/namelist.forcing . +#cp -n ../config/namelist.oce . +#cp -n ../config/namelist.dyn . +#cp -n ../config/namelist.tra . +#cp -n ../config/namelist.ice . +#cp -n ../config/namelist.io . +#cp -n ../config/namelist.icepack . + +#___DETERMINE SLURM JOBID+OUTPUTFILE____________________________________________ +jobid=$(echo $SLURM_JOB_ID | cut -d"." -f1) +fname="fesom2.0.out" + +#___PUT JOB IN QUEUE____________________________________________________________ +date +srun --mpi=pmi2 ./fesom.x > fesom2.0.out +date + +#qstat -f $PBS_JOBID +#export EXITSTATUS=$? +#if [ ${EXITSTATUS} -eq 0 ] || [ ${EXITSTATUS} -eq 127 ] ; then +#sbatch job_albedo +#fi + +Resultpath='/albedo/work/user/...' +test -e $Resultpath/fesom.2019.oce.restart && exit + +IsInFile=$( tail -3 fesom2.0.out | grep -c timesteps) +if (( IsInFile > 0 )); then +# submit next #job \ + echo "submitting next job" + cp fesom2.0.out fesom.out.done + sbatch job_albedo +else + echo "something is wrong, last line of fesom.out reads" + echo $( tail -1 fesom2.0.out) + echo "abnormal termination of job script" +fi diff --git a/config/bin_4p3z2d/namelist.config b/config/bin_4p3z2d/namelist.config new file mode 100644 index 000000000..ffff081c0 --- /dev/null +++ b/config/bin_4p3z2d/namelist.config @@ -0,0 +1,76 @@ +! This is the namelist file for model general configuration + +&modelname +runid='fesom' +/ + +×tep +step_per_day=32 !96 !96 !72 !72 !45 !72 !96 +run_length= 1 !62 !62 !62 !28 +run_length_unit='y' ! y, m, d, s +/ + +&clockinit ! the model starts at +timenew=0.0 +daynew=1 +yearnew=1958 +/ + +&paths +MeshPath='/albedo/work/projects/p_recompdaf/frbunsen/FESOM2/meshes/core2/' +ClimateDataPath='/albedo/work/projects/MarESys/ogurses/input/corrected_input/' +ResultPath='/albedo/work/user/...' +/ + +&restart_log +restart_length=1 ! --> do netcdf restart ( only required for d,h,s cases, y, m take 1) +restart_length_unit='y' !output period: y, d, h, s, off +raw_restart_length=1 ! --> do core dump restart +raw_restart_length_unit='off' ! e.g. y, d, h, s, off +bin_restart_length=1 ! --> do derived type binary restart +bin_restart_length_unit='off' ! e.g. y, d, h, s, off +logfile_outfreq=960 !in logfile info. output frequency, # steps +/ + +&ale_def +which_ALE='zstar' ! 'linfs','zlevel', 'zstar' +use_partial_cell=.true. +/ + +&geometry +cartesian=.false. +fplane=.false. +cyclic_length=360 ![degree] +rotated_grid=.true. !option only valid for coupled model case now +force_rotation=.true. +alphaEuler=50. ![degree] Euler angles, convention: +betaEuler=15. ![degree] first around z, then around new x, +gammaEuler=-90. ![degree] then around new z. +/ + +&calendar +include_fleapyear=.false. +/ + +&run_config +use_ice=.true. ! ocean+ice +use_cavity=.false. ! +use_cavity_partial_cell=.false. +use_floatice = .false. +use_sw_pene=.true. +flag_debug=.false. +use_transit=.false. +/ + +&machine +n_levels=2 +n_part= 12, 36 ! 432 number of partitions on each hierarchy level +/ + +&icebergs +use_icesheet_coupling=.false. +ib_num=1 +use_icebergs=.false. +steps_per_ib_step=8 +ib_async_mode=0 +/ diff --git a/config/bin_4p3z2d/namelist.dyn b/config/bin_4p3z2d/namelist.dyn new file mode 100644 index 000000000..fb7919588 --- /dev/null +++ b/config/bin_4p3z2d/namelist.dyn @@ -0,0 +1,24 @@ +&dynamics_visc +visc_gamma0 = 0.003 ! [m/s], backgroung viscosity= gamma0*len, it should be as small a s possible (keep it < 0.01 m/s). +visc_gamma1 = 0.1 ! [nodim], for computation of the flow aware viscosity +visc_gamma2 = 0.285 ! [s/m], is only used in easy backscatter option +visc_easybsreturn= 1.5 + +opt_visc = 5 +! 5=Kinematic (easy) Backscatter +! 6=Biharmonic flow aware (viscosity depends on velocity Laplacian) +! 7=Biharmonic flow aware (viscosity depends on velocity differences) +! 8=Dynamic Backscatter + +use_ivertvisc= .true. +/ + +&dynamics_general +momadv_opt = 2 ! option for momentum advection in moment only =2 +use_freeslip = .false. ! Switch on free slip +use_wsplit = .false. ! Switch for implicite/explicte splitting of vert. velocity +wsplit_maxcfl= 1.0 ! maximum allowed CFL criteria in vertical (0.5 < w_max_cfl < 1.) + ! in older FESOM it used to be w_exp_max=1.e-3 +ldiag_KE=.false. ! activates energy diagnostics +/ + diff --git a/config/bin_4p3z2d/namelist.forcing b/config/bin_4p3z2d/namelist.forcing new file mode 100644 index 000000000..d890c69ec --- /dev/null +++ b/config/bin_4p3z2d/namelist.forcing @@ -0,0 +1,80 @@ +! This is the namelist file for forcing + +&forcing_exchange_coeff +Ce_atm_oce=0.00175 ! exchange coeff. of latent heat over open water +Ch_atm_oce=0.00175 ! exchange coeff. of sensible heat over open water +Cd_atm_oce=0.001 ! drag coefficient between atmosphere and water +Ce_atm_ice=0.00175 ! exchange coeff. of latent heat over ice +Ch_atm_ice=0.00175 ! exchange coeff. of sensible heat over ice +Cd_atm_ice=0.0012 ! drag coefficient between atmosphere and ice +Swind =0.0 ! parameterization for coupled current feedback +/ + +&forcing_bulk +AOMIP_drag_coeff=.false. +ncar_bulk_formulae=.true. +ncar_bulk_z_wind=10.0 ! height at which wind forcing is located (CORE, JRA-do: 10m, JRA, NCEP:2m) +ncar_bulk_z_tair=10.0 ! height at which temp forcing is located (CORE, JRA-do: 10m, JRA, NCEP:2m) +ncar_bulk_z_shum=10.0 ! height at which humi forcing is located (CORE, JRA-do: 10m, JRA, NCEP:2m) + +/ + +&land_ice +use_landice_water=.false. +landice_start_mon=5 +landice_end_mon=10 +fwf_path='./mesh/' + +/ + +&age_tracer +use_age_tracer=.false. +use_age_mask=.false. +age_tracer_path='./mesh/' +age_start_year=2000 + +/ + +&nam_sbc + nm_xwind_file = '/albedo/work/projects/MarESys/FROM-OLLIE/forcing_JRA55-do-v1.4.0_clim61/uas.clim61' ! name of file with winds, if nm_sbc=2 + nm_ywind_file = '/albedo/work/projects/MarESys/FROM-OLLIE/forcing_JRA55-do-v1.4.0_clim61/vas.clim61' ! name of file with winds, if nm_sbc=2 + nm_xstre_file = '/albedo/work/projects/MarESys/FROM-OLLIE/forcing_JRA55-do-v1.4.0_clim61/uas.clim61' ! name of file with winds, if nm_sbc=2 + nm_ystre_file = '/albedo/work/projects/MarESys/FROM-OLLIE/forcing_JRA55-do-v1.4.0_clim61/vas.clim61' ! name of file with winds, if nm_sbc=2 + nm_humi_file = '/albedo/work/projects/MarESys/FROM-OLLIE/forcing_JRA55-do-v1.4.0_clim61/huss.clim61' ! name of file with humidity + nm_qsr_file = '/albedo/work/projects/MarESys/FROM-OLLIE/forcing_JRA55-do-v1.4.0_clim61/rsds.clim61' ! name of file with solar heat + nm_qlw_file = '/albedo/work/projects/MarESys/FROM-OLLIE/forcing_JRA55-do-v1.4.0_clim61/rlds.clim61' ! name of file with Long wave + nm_tair_file = '/albedo/work/projects/MarESys/FROM-OLLIE/forcing_JRA55-do-v1.4.0_clim61/tas.clim61' ! name of file with 2m air temperature + nm_prec_file = '/albedo/work/projects/MarESys/FROM-OLLIE/forcing_JRA55-do-v1.4.0_clim61/prra.clim61' ! name of file with total precipitation + nm_snow_file = '/albedo/work/projects/MarESys/FROM-OLLIE/forcing_JRA55-do-v1.4.0_clim61/prsn.clim61' ! name of file with snow precipitation + nm_mslp_file = '/albedo/work/projects/MarESys/FROM-OLLIE/forcing_JRA55-do-v1.4.0_clim61/psl.clim61' ! air_pressure_at_sea_level + nm_xwind_var = 'uas' ! name of variable in file with wind + nm_ywind_var = 'vas' ! name of variable in file with wind + nm_xstre_var = 'uas' ! name of variable in file with wind + nm_ystre_var = 'vas' ! name of variable in file with wind + nm_humi_var = 'huss' ! name of variable in file with humidity + nm_qsr_var = 'rsds' ! name of variable in file with solar heat + nm_qlw_var = 'rlds' ! name of variable in file with Long wave + nm_tair_var = 'tas' ! name of variable in file with 2m air temperature + nm_prec_var = 'prra' ! name of variable in file with total precipitation + nm_snow_var = 'prsn' ! name of variable in file with total precipitation + nm_mslp_var = 'psl' ! name of variable in file with air_pressure_at_sea_level + nm_nc_iyear = 1900 + nm_nc_imm = 1 ! initial month of time axis in netCDF + nm_nc_idd = 1 ! initial day of time axis in netCDF + nm_nc_freq = 1 ! data points per day (i.e. 86400 if the time axis is in seconds) + nm_nc_tmid = 0 ! 1 if the time stamps are given at the mid points of the netcdf file, 0 otherwise (i.e. 1 in CORE1, CORE2; 0 in JRA55) + y_perpetual=.true. + l_xwind=.true. l_ywind=.true. l_xstre=.false. l_ystre=.false. l_humi=.true. l_qsr=.true. l_qlw=.true. l_tair=.true. l_prec=.true. l_mslp=.true. l_cloud=.false. l_snow=.true. + nm_runoff_file ='/albedo/pool/FESOM/forcing/CORE2/runoff.nc' + runoff_data_source ='CORE2' !Dai09, CORE2 + !runoff_data_source ='Dai09' !Dai09, CORE2, JRA55 + !runoff_climatology =.true. + sss_data_source ='CORE2' + nm_sss_data_file ='/albedo/pool/FESOM/forcing/CORE2/PHC2_salx.nc' + chl_data_source ='None' !'Sweeney' monthly chlorophyll climatology or 'NONE' for constant chl_const (below). Make use_sw_pene=.TRUE. in namelist.config! + nm_chl_data_file ='/pool/data/AWICM/FESOM2/FORCING/JRA55-do-v1.4.0/Sweeney/Sweeney_2005.nc' + chl_const = 0.1 + use_runoff_mapper = .FALSE. + runoff_basins_file = 'runoff_maps_regular.nc' + runoff_radius = 500000. +/ diff --git a/config/bin_4p3z2d/namelist.ice b/config/bin_4p3z2d/namelist.ice new file mode 100644 index 000000000..bcd86f145 --- /dev/null +++ b/config/bin_4p3z2d/namelist.ice @@ -0,0 +1,31 @@ +! Ice namelist +&ice_dyn +whichEVP=0 ! 0=standart; 1=mEVP; 2=aEVP +Pstar=30000.0 ! [N/m^2] +ellipse=2.0 +c_pressure=20.0 ! ice concentration parameter used in ice strength computation +delta_min=1.0e-11 ! [s^(-1)] +evp_rheol_steps=120 ! number of EVP subcycles +alpha_evp=250 ! constant that control numerical stability of mEVP. Adjust with resolution. +beta_evp=250 ! constant that control numerical stability of mEVP. Adjust with resolution. +c_aevp=0.15 ! a tuning constant in aEVP. Adjust with resolution. +Cd_oce_ice=0.0055 ! drag coef. oce - ice +ice_gamma_fct=0.5 ! smoothing parameter +ice_diff=0.0 ! diffusion to stabilize +theta_io=0.0 ! rotation angle +ice_ave_steps=1 ! ice step=ice_ave_steps*oce_step +/ + +&ice_therm +Sice=4.0 ! Ice salinity 3.2--5.0 ppt. +h0=.5 ! Lead closing parameter [m] +emiss_ice=0.97 ! Emissivity of Snow/Ice, +emiss_wat=0.97 ! Emissivity of open water +albsn=0.81 ! Albedo: frozen snow +albsnm=0.77 ! melting snow +albi=0.7 ! frozen ice +albim=0.68 ! melting ice +albw=0.1 ! open water +con=2.1656 ! Thermal conductivities: ice; W/m/K +consn=0.31 ! snow +/ diff --git a/config/bin_4p3z2d/namelist.icepack b/config/bin_4p3z2d/namelist.icepack new file mode 100644 index 000000000..ed0dd4d4c --- /dev/null +++ b/config/bin_4p3z2d/namelist.icepack @@ -0,0 +1,146 @@ +&env_nml ! In the original release these variables are defined in the icepack.settings + nicecat = 5 ! number of ice thickness categories + nfsdcat = 1 ! number of floe size categories + nicelyr = 4 ! number of vertical layers in the ice + nsnwlyr = 4 ! number of vertical layers in the snow + ntraero = 0 ! number of aerosol tracers (up to max_aero in ice_domain_size.F90) + trzaero = 0 ! number of z aerosol tracers (up to max_aero = 6) + tralg = 0 ! number of algal tracers (up to max_algae = 3) + trdoc = 0 ! number of dissolve organic carbon (up to max_doc = 3) + trdic = 0 ! number of dissolve inorganic carbon (up to max_dic = 1) + trdon = 0 ! number of dissolve organic nitrogen (up to max_don = 1) + trfed = 0 ! number of dissolved iron tracers (up to max_fe = 2) + trfep = 0 ! number of particulate iron tracers (up to max_fe = 2) + nbgclyr = 0 ! number of zbgc layers + trbgcz = 0 ! set to 1 for zbgc tracers (needs TRBGCS = 0 and TRBRI = 1) + trzs = 0 ! set to 1 for zsalinity tracer (needs TRBRI = 1) + trbri = 0 ! set to 1 for brine height tracer + trage = 0 ! set to 1 for ice age tracer + trfy = 0 ! set to 1 for first-year ice area tracer + trlvl = 0 ! set to 1 for level and deformed ice tracers + trpnd = 0 ! set to 1 for melt pond tracers + trbgcs = 0 ! set to 1 for skeletal layer tracers (needs TRBGCZ = 0) + ndtd = 1 ! dynamic time steps per thermodynamic time step +/ + +&grid_nml + kcatbound = 1 +/ + +&tracer_nml + tr_iage = .false. + tr_FY = .false. + tr_lvl = .false. + tr_pond_cesm = .false. + tr_pond_topo = .false. + tr_pond_lvl = .false. + tr_aero = .false. + tr_fsd = .false. +/ + +&thermo_nml + kitd = 1 + ktherm = 1 + conduct = 'bubbly' + a_rapid_mode = 0.5e-3 + Rac_rapid_mode = 10.0 + aspect_rapid_mode = 1.0 + dSdt_slow_mode = -5.0e-8 + phi_c_slow_mode = 0.05 + phi_i_mushy = 0.85 + ksno = 0.3 +/ + +&shortwave_nml + shortwave = 'ccsm3' + albedo_type = 'ccsm3' + albicev = 0.78 + albicei = 0.36 + albsnowv = 0.98 + albsnowi = 0.70 + albocn = 0.1 + ahmax = 0.3 + R_ice = 0. + R_pnd = 0. + R_snw = 1.5 + dT_mlt = 1.5 + rsnw_mlt = 1500. + kalg = 0.6 +/ + +&ponds_nml + hp1 = 0.01 + hs0 = 0. + hs1 = 0.03 + dpscale = 1.e-3 + frzpnd = 'hlid' + rfracmin = 0.15 + rfracmax = 1. + pndaspect = 0.8 +/ + +&forcing_nml + formdrag = .false. + atmbndy = 'default' + calc_strair = .true. + calc_Tsfc = .true. + highfreq = .false. + natmiter = 5 + ustar_min = 0.0005 + emissivity = 0.95 + fbot_xfer_type = 'constant' + update_ocn_f = .false. + l_mpond_fresh = .false. + tfrz_option = 'linear_salt' + oceanmixed_ice = .true. + wave_spec_type = 'none' +/ + +&dynamics_nml + kstrength = 1 + krdg_partic = 1 + krdg_redist = 1 + mu_rdg = 3 + Cf = 17. + P_star = 27000. + C_star = 20. +/ + +!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +!!!!!!!!!! Icepack output namelist !!!!!!!!!! +!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +&nml_list_icepack +io_list_icepack = 'aicen ',1, 'm', 4, ! Sea ice concentration + 'vicen ',1, 'm', 4, ! Volume per unit area of ice + 'vsnon ',1, 'm', 4, ! Volume per unit area of snow + !'Tsfcn ',1, 'm', 4, ! Sea ice surf. temperature + !'iagen ',1, 'm', 4, ! Sea ice age + !'FYn ',1, 'm', 4, ! First year ice + !'lvln ',1, 'm', 4, ! Ridged sea ice area and volume + !'pond_cesmn',1, 'm', 4, ! Melt ponds area, volume and refrozen lid thickness + !'pond_topon',1, 'm', 4, ! Melt ponds area, volume and refrozen lid thickness + !'pond_lvln ',1, 'm', 4, ! Melt ponds area, volume and refrozen lid thickness + !'brinen ',1, 'm', 4, ! Volume fraction of ice with dynamic salt + !'qicen ',1, 'm', 4, ! Sea ice enthalpy + !'sicen ',1, 'm', 4, ! Sea ice salinity + !'qsnon ',1, 'm', 4, ! Snow enthalpy + ! Average over thicknes classes + !'aice ',1, 'm', 4, ! Sea ice concentration + !'vice ',1, 'm', 4, ! Volume per unit area of ice + !'vsno ',1, 'm', 4, ! Volume per unit area of snow + !'Tsfc ',1, 'm', 4, ! Sea ice surf. temperature + !'iage ',1, 'm', 4, ! Sea ice age + !'FY ',1, 'm', 4, ! First year ice + !'lvl ',1, 'm', 4, ! Ridged sea ice area and volume + !'pond_cesm ',1, 'm', 4, ! Melt ponds area, volume and refrozen lid thickness + !'pond_topo ',1, 'm', 4, ! Melt ponds area, volume and refrozen lid thickness + !'pond_lvl ',1, 'm', 4, ! Melt ponds area, volume and refrozen lid thickness + !'brine ',1, 'm', 4, ! Volume fraction of ice with dynamic salt + !'qice ',1, 'm', 4, ! Sea ice enthalpy + !'sice ',1, 'm', 4, ! Sea ice salinity + !'qsno ',1, 'm', 4, ! Snow enthalpy + ! Other variables + !'uvel ',1, 'm', 4, ! x-component of sea ice velocity + !'vvel ',1, 'm', 4, ! y-component of sea ice velocity +/ diff --git a/config/bin_4p3z2d/namelist.icepack.cesm.ponds b/config/bin_4p3z2d/namelist.icepack.cesm.ponds new file mode 100644 index 000000000..51aa33191 --- /dev/null +++ b/config/bin_4p3z2d/namelist.icepack.cesm.ponds @@ -0,0 +1,144 @@ +&env_nml ! In the original release these variables are defined in the icepack.settings + nicecat = 5 ! number of ice thickness categories + nfsdcat = 1 ! number of floe size categories + nicelyr = 4 ! number of vertical layers in the ice + nsnwlyr = 4 ! number of vertical layers in the snow + ntraero = 0 ! number of aerosol tracers (up to max_aero in ice_domain_size.F90) + trzaero = 0 ! number of z aerosol tracers (up to max_aero = 6) + tralg = 0 ! number of algal tracers (up to max_algae = 3) + trdoc = 0 ! number of dissolve organic carbon (up to max_doc = 3) + trdic = 0 ! number of dissolve inorganic carbon (up to max_dic = 1) + trdon = 0 ! number of dissolve organic nitrogen (up to max_don = 1) + trfed = 0 ! number of dissolved iron tracers (up to max_fe = 2) + trfep = 0 ! number of particulate iron tracers (up to max_fe = 2) + nbgclyr = 0 ! number of zbgc layers + trbgcz = 0 ! set to 1 for zbgc tracers (needs TRBGCS = 0 and TRBRI = 1) + trzs = 0 ! set to 1 for zsalinity tracer (needs TRBRI = 1) + trbri = 0 ! set to 1 for brine height tracer + trage = 0 ! set to 1 for ice age tracer + trfy = 0 ! set to 1 for first-year ice area tracer + trlvl = 0 ! set to 1 for level and deformed ice tracers + trpnd = 1 ! set to 1 for melt pond tracers + trbgcs = 0 ! set to 1 for skeletal layer tracers (needs TRBGCZ = 0) + ndtd = 1 ! dynamic time steps per thermodynamic time step +/ + +&grid_nml + kcatbound = 1 +/ + +&tracer_nml + tr_iage = .false. + tr_FY = .false. + tr_lvl = .false. + tr_pond_cesm = .true. + tr_pond_topo = .false. + tr_pond_lvl = .false. + tr_aero = .false. + tr_fsd = .false. +/ + +&thermo_nml + kitd = 1 + ktherm = 1 + conduct = 'bubbly' + a_rapid_mode = 0.5e-3 + Rac_rapid_mode = 10.0 + aspect_rapid_mode = 1.0 + dSdt_slow_mode = -5.0e-8 + phi_c_slow_mode = 0.05 + phi_i_mushy = 0.85 +/ + +&shortwave_nml + shortwave = 'dEdd' + albedo_type = 'ccsm3' + albicev = 0.78 + albicei = 0.36 + albsnowv = 0.98 + albsnowi = 0.70 + ahmax = 0.3 + R_ice = 0. + R_pnd = 0. + R_snw = 1.5 + dT_mlt = 1.5 + rsnw_mlt = 1500. + kalg = 0.6 +/ + +&ponds_nml + hp1 = 0.01 + hs0 = 0. + hs1 = 0.03 + dpscale = 1.e-3 + frzpnd = 'hlid' + rfracmin = 0.15 + rfracmax = 1. + pndaspect = 0.8 +/ + +&forcing_nml + formdrag = .false. + atmbndy = 'default' + calc_strair = .true. + calc_Tsfc = .true. + highfreq = .false. + natmiter = 5 + ustar_min = 0.0005 + emissivity = 0.95 + fbot_xfer_type = 'constant' + update_ocn_f = .false. + l_mpond_fresh = .false. + tfrz_option = 'linear_salt' + oceanmixed_ice = .true. + wave_spec_type = 'none' +/ + +&dynamics_nml + kstrength = 1 + krdg_partic = 1 + krdg_redist = 1 + mu_rdg = 3 + Cf = 17. + P_star = 27000. + C_star = 20. +/ + +!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +!!!!!!!!!! Icepack output namelist !!!!!!!!!! +!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +&nml_list_icepack +io_list_icepack = 'aicen ',1, 'm', 4, ! Sea ice concentration + 'vicen ',1, 'm', 4, ! Volume per unit area of ice + 'vsnon ',1, 'm', 4, ! Volume per unit area of snow + !'Tsfcn ',1, 'm', 4, ! Sea ice surf. temperature + !'iagen ',1, 'm', 4, ! Sea ice age + !'FYn ',1, 'm', 4, ! First year ice + !'lvln ',1, 'm', 4, ! Ridged sea ice area and volume + !'pond_cesmn',1, 'm', 4, ! Melt ponds area, volume and refrozen lid thickness + !'pond_topon',1, 'm', 4, ! Melt ponds area, volume and refrozen lid thickness + !'pond_lvln ',1, 'm', 4, ! Melt ponds area, volume and refrozen lid thickness + !'brinen ',1, 'm', 4, ! Volume fraction of ice with dynamic salt + !'qicen ',1, 'm', 4, ! Sea ice enthalpy + !'sicen ',1, 'm', 4, ! Sea ice salinity + !'qsnon ',1, 'm', 4, ! Snow enthalpy + ! Average over thicknes classes + !'aice ',1, 'm', 4, ! Sea ice concentration + !'vice ',1, 'm', 4, ! Volume per unit area of ice + !'vsno ',1, 'm', 4, ! Volume per unit area of snow + !'Tsfc ',1, 'm', 4, ! Sea ice surf. temperature + !'iage ',1, 'm', 4, ! Sea ice age + !'FY ',1, 'm', 4, ! First year ice + !'lvl ',1, 'm', 4, ! Ridged sea ice area and volume + !'pond_cesm ',1, 'm', 4, ! Melt ponds area, volume and refrozen lid thickness + !'pond_topo ',1, 'm', 4, ! Melt ponds area, volume and refrozen lid thickness + !'pond_lvl ',1, 'm', 4, ! Melt ponds area, volume and refrozen lid thickness + !'brine ',1, 'm', 4, ! Volume fraction of ice with dynamic salt + !'qice ',1, 'm', 4, ! Sea ice enthalpy + !'sice ',1, 'm', 4, ! Sea ice salinity + !'qsno ',1, 'm', 4, ! Snow enthalpy + ! Other variables + !'uvel ',1, 'm', 4, ! x-component of sea ice velocity + !'vvel ',1, 'm', 4, ! y-component of sea ice velocity +/ diff --git a/config/bin_4p3z2d/namelist.io b/config/bin_4p3z2d/namelist.io new file mode 100644 index 000000000..aef0697d9 --- /dev/null +++ b/config/bin_4p3z2d/namelist.io @@ -0,0 +1,138 @@ +&diag_list +ldiag_solver =.false. +lcurt_stress_surf=.false. +ldiag_curl_vel3 =.false. +ldiag_Ri =.false. +ldiag_turbflux =.false. +ldiag_salt3D =.false. +ldiag_dMOC =.false. +ldiag_DVD =.false. +ldiag_forc =.false. +ldiag_extflds =.false. +/ + +&nml_general +io_listsize =150 !number of streams to allocate. shallbe large or equal to the number of streams in &nml_list +vec_autorotate =.false. +/ + +! for sea ice related variables use_ice should be true, otherewise there will be no output +! for 'curl_surf' to work lcurt_stress_surf must be .true. otherwise no output +! for 'fer_C', 'bolus_u', 'bolus_v', 'bolus_w', 'fer_K' to work Fer_GM must be .true. otherwise no output +! 'otracers' - all other tracers if applicable +! for 'dMOC' to work ldiag_dMOC must be .true. otherwise no output +&nml_list +io_list = 'sst ',1, 'm', 4, + 'sss ',1, 'm', 4, + 'ssh ',1, 'm', 4, + 'uice ',1, 'm', 4, + 'vice ',1, 'm', 4, + 'a_ice ',1, 'm', 4, + 'm_ice ',1, 'm', 4, + 'm_snow ',1, 'm', 4, + 'MLD1 ',1, 'm', 4, + 'MLD2 ',1, 'm', 4, + 'MLD3 ',1, 'm', 4, + 'tx_sur ',1, 'm', 4, + 'ty_sur ',1, 'm', 4, + 'temp ',1, 'm', 4, + 'salt ',1, 'm', 8, + 'otracers ',1, 'm', 4, + 'N2 ',1, 'y', 4, + 'Kv ',1, 'y', 4, + 'u ',1, 'm', 4, + 'v ',1, 'm', 4, + 'unod ',1, 'm', 4, + 'vnod ',1, 'm', 4, + 'w ',1, 'm', 4, + 'Av ',1, 'y', 4, + 'bolus_u ',1, 'y', 4, + 'bolus_v ',1, 'y', 4, + 'bolus_w ',1, 'y', 4, + 'dpCO2s ',1, 'm', 4, + 'pCO2s ',1, 'm', 4, + 'CO2f ',1, 'm', 4, + 'Hp ',1, 'm', 4, + 'aFe ',1, 'm', 4, + 'aN ',1, 'm', 4, + 'denb ',1, 'm', 4, + 'benN ',1, 'm', 4, + 'benC ',1, 'm', 4, + 'benSi ',1, 'm', 4, + 'benCalc ',1, 'm', 4, + 'Chldegd ',1, 'm', 4, + 'Chldegn ',1, 'm', 4, + 'Chldegc ',1, 'm', 4, + 'NNAd ',1, 'm', 4, + 'NNAn ',1, 'm', 4, + 'NNAc ',1, 'm', 4, + 'GPPd ',1, 'm', 4, + 'GPPn ',1, 'm', 4, + 'GPPc ',1, 'm', 4, + 'NPPd ',1, 'm', 4, + 'NPPn ',1, 'm', 4, + 'NPPc ',1, 'm', 4, + 'PAR ',1, 'm', 4, + 'CO2 ',1, 'm', 4, + 'pH ',1, 'm', 4, + 'pCO2 ',1, 'm', 4, + 'HCO3 ',1, 'm', 4, + 'CO3 ',1, 'm', 4, + 'OmegaC ',1, 'm', 4, + 'kspc ',1, 'm', 4, + 'rhoSW ',1, 'm', 4, + 'wsink_det1',1, 'm', 8, + 'wsink_det2',1, 'm', 8, + 'rho_det1',1, 'm', 8, + 'rho_det2',1, 'm', 8, + 'scaling_rho_1',1, 'm', 8, + 'scaling_rho_2',1, 'm', 8, + 'scaling_visc',1, 'm', 8, + 'grazmeso_tot',1, 'm', 4, + 'grazmeso_n',1, 'm', 4, + 'grazmeso_d',1, 'm', 4, + 'grazmeso_c',1, 'm', 4, + 'respmeso',1, 'm', 4, + 'respmacro',1, 'm', 4, + 'respmicro',1, 'm', 4, + 'calcdiss',1, 'm', 4, + 'calcif',1, 'm', 4, + 'aggn',1, 'm', 4, + 'aggd',1, 'm', 4, + 'aggc',1, 'm', 4, + 'docexn',1, 'm', 4, + 'docexd',1, 'm', 4, + 'docexc',1, 'm', 4, + 'respn',1, 'm', 4, + 'respd',1, 'm', 4, + 'respc',1, 'm', 4, + 'NPPp ',1, 'm', 4, + 'GPPp ',1, 'm', 4, + 'NNAp ',1, 'm', 4, + 'Chldegp ',1, 'm', 4, + 'grazmeso_p',1, 'm', 4, + 'aggp ',1, 'm', 4, + 'respp ',1, 'm', 4, + 'docexp ',1, 'm', 4, + 'TTemp_diatoms',1, 'm', 4, + 'TTemp_phyto',1, 'm', 4, + 'TTemp_cocco',1, 'm', 4, + 'TTemp_phaeo',1, 'm', 4, + 'TPhyCO2 ',1, 'm', 4, + 'TDiaCO2 ',1, 'm', 4, + 'TCoccoCO2 ',1, 'm', 4, + 'TPhaeoCO2 ',1, 'm', 4, + 'TqLF_phyto ',1, 'm', 4, + 'TqLF_diatoms',1, 'm', 4, + 'TqLF_cocco ',1, 'm', 4, + 'TqLF_phaeo ',1, 'm', 4, + 'TCphotLL_phyto ',1, 'm', 4, + 'TCphotLL_dia ',1, 'm', 4, + 'TCphotLL_cocco ',1, 'm', 4, + 'TCphotLL_phaeo ',1, 'm', 4, + 'TCphot_phyto',1, 'm', 4, + 'TCphot_diatoms',1, 'm', 4, + 'TCphot_cocco',1, 'm', 4, + 'TCphot_phaeo',1, 'm', 4, + 'TSi_assimDia',1, 'm', 4, +/ diff --git a/config/bin_4p3z2d/namelist.oce b/config/bin_4p3z2d/namelist.oce new file mode 100644 index 000000000..7af6867f7 --- /dev/null +++ b/config/bin_4p3z2d/namelist.oce @@ -0,0 +1,26 @@ +! The namelist file for the finite-volume ocean model + +&oce_dyn +C_d=0.0025 ! Bottom drag, nondimensional +A_ver= 1.e-4 ! Vertical viscosity, m^2/s +scale_area=5.8e9 ! Visc. and diffus. are for an element with scale_area +SPP=.false. ! Salt Plume Parameterization +Fer_GM=.true. ! to swith on/off GM after Ferrari et al. 2010 +K_GM_max = 2000.0 ! max. GM thickness diffusivity (m2/s) +K_GM_min = 2.0 ! max. GM thickness diffusivity (m2/s) +K_GM_bvref = 2 ! def of bvref in ferreira scaling 0=srf,1=bot mld,2=mean over mld,3=weighted mean over mld +K_GM_rampmax = -1.0 ! Resol >K_GM_rampmax[km] GM on +K_GM_rampmin = -1.0 ! Resol 8 if (ciso == .true.) otherwise -> 4 +use_MEDUSA = .false. ! Main switch for the sediment model MEDUSA +sedflx_num = 0 ! if 0: no file from MEDUSA is read but default sediment +bottflx_num = 4 ! if ciso&ciso_14: =8; if .not.ciso_14: =6; no ciso: =4 +use_atbox = .false. +add_loopback = .false. ! add loopback fluxes through rivers to the surface +lb_tscale = 1.0 ! /year: fraction of loopback fluxes yearly added to the surface +/ + +&pasinking +Vdet_a = 0.0288 ! [1/day] +Vcalc = 0.0144 ! [1/day] +/ + +&painitialization_N +cPhyN = 0.2d0 +cHetN = 0.2d0 +cZoo2N = 0.2d0 +/ + +&paArrhenius +recom_Tref = 288.15d0 ! [K] +C2K = 273.15d0 ! Conversion from degrees C to K +Ae = 4500.d0 ! [K] Slope of the linear part of the Arrhenius function +Tmax_phaeo = 16d0 ! [°C] For Blanchard temp fxn: maximum temperature +Topt_phaeo = 6.7982d0 ! [°C] For Blanchard temp fxn: optimum temperature +uopt_phaeo = 0.6903d0 ! [1/day] For Blanchard temp fxn: optimum growth rate +beta_phaeo = 0.7114d0 ! [unitless] For Blanchard temp fxn +ord_d = -0.2216d0 ! diatom ordonnée +expon_d = 0.0406d0 ! diatom exponent +ord_phy = -0.7338d0 ! small phyto ordonnée +expon_phy = 0.06422d0 ! small phyto exponent +ord_cocco = -0.2310d0 ! coccolitho ordonnée +expon_cocco = 0.0327d0 ! coccolitho exponent +ord_phaeo = -0.2310d0 ! phaeocystis ordonnée +expon_phaeo = 0.0327d0 ! phaeocystis exponent +reminSi = 0.02d0 +k_o2_remin = 15.d0 ! NEW O2remin mmol m-3; Table 1 in Cram 2018 cites DeVries & Weber 2017 for a range of 0-30 mmol m-3 +!d1_d = 0.001d0 ! 42°C version +!d2_d = 0.2d0 ! 42°C version +!d1_phy = 0.0016d0 ! 42°C version +!d2_phy = 0.1987d0 ! 42°C version +!d1_cocco = 0.0025d0 ! 42°C version +!d2_cocco = 0.17d0 ! 42°C version +/ + +&palimiter_function +NMinSlope = 50.d0 +SiMinSlope = 1000.d0 +NCmin = 0.04d0 !0.05d0 +NCmin_d = 0.04d0 !0.05d0 +NCmin_c = 0.04d0 ! NEW +NCmin_p = 0.04d0 ! NEW for Phaeocystis +SiCmin = 0.04d0 +k_Fe = 0.04d0 +k_Fe_d = 0.12d0 +k_Fe_c = 0.09d0 ! NEW +k_Fe_p = 0.09d0 ! NEW for Phaeocystis (to be tuned) +k_si = 4.d0 +P_cm = 3.0d0 ! [1/day] Rate of C-specific photosynthesis +P_cm_d = 3.5d0 +P_cm_c = 2.8d0 ! NEW +P_cm_p = 0.75d0 ! NEW for Phaeocystis (to be tuned) +/ + +&palight_calculations +k_w = 0.04d0 ! [1/m] Light attenuation coefficient +a_chl = 0.03d0 ! [1/m * 1/(mg Chl)] Chlorophyll specific attenuation coefficients +/ + +&paphotosynthesis +alfa = 0.15d0 !0.14d0 ! [(mmol C*m2)/(mg Chl*W*day)] ! NEW value for Phaeocystis +alfa_d = 0.19d0 ! An initial slope of the P-I curve +alfa_c = 0.10d0 ! NEW +alfa_p = 0.17d0 ! NEW for Phaeocystis (to be tuned) +parFrac = 0.43d0 +/ + +&paassimilation +V_cm_fact = 0.7d0 ! scaling factor for temperature dependent maximum of C-specific N-uptake +V_cm_fact_d = 0.7d0 +V_cm_fact_c = 0.7d0 ! NEW +V_cm_fact_p = 0.7d0 ! NEW for Phaeocystis +NMaxSlope = 1000.d0 ! Max slope for limiting function +SiMaxSlope = 1000.d0 +NCmax = 0.2d0 ! [mmol N/mmol C] Maximum cell quota of nitrogen (N:C) +NCmax_d = 0.2d0 +NCmax_c = 0.15d0 ! NEW +NCmax_p = 0.15d0 ! NEW for Phaeocystis (to be tuned) +SiCmax = 0.8d0 +NCuptakeRatio = 0.2d0 ! [mmol N/mmol C] Maximum uptake ratio of N:C +NCUptakeRatio_d = 0.2d0 +NCUptakeRatio_c = 0.2d0 ! NEW +NCUptakeRatio_p = 0.2d0 ! NEW for Phaeocystis +SiCUptakeRatio = 0.2d0 +k_din = 0.55d0 ! [mmol N/m3] Half-saturation constant for nitrate uptake +k_din_d = 1.0d0 +k_din_c = 0.9d0 ! NEW +k_din_p = 0.7d0 ! NEW for Phaeocystis (to be tuned) +Chl2N_max = 3.15d0 ! [mg CHL/mmol N] Maximum CHL a : N ratio = 0.3 gCHL gN^-1 +Chl2N_max_d = 4.2d0 +Chl2N_max_c = 3.5d0 ! NEW +Chl2N_max_p = 2.6d0 ! NEW for Phaeocystis +res_phy = 0.01d0 ! [1/day] Maintenance respiration rate constant +res_phy_d = 0.01d0 +res_phy_c = 0.01d0 ! NEW +res_phy_p = 0.01d0 ! NEW for phaeocystis +biosynth = 2.33d0 ! [mmol C/mmol N] Cost of biosynthesis +biosynthSi = 0.d0 +/ + +&pairon_chem +totalligand = 1.d0 ! [mumol/m3] order 1. Total free ligand +ligandStabConst = 100.d0 ! [m3/mumol] order 100. Ligand-free iron stability constant +/ + +&pazooplankton +graz_max = 0.31d0 ! [mmol N/(m3 * day)] Maximum grazing loss parameter +epsilonr = 0.09d0 ! [(mmol N)2 /m6] Half saturation constant for grazing loss +res_het = 0.028d0 ! [1/day] Respiration by heterotrophs and mortality (loss to detritus) +Redfield = 6.625 ! [mmol C/mmol N] Redfield ratio of C:N = 106:16 +loss_het = 0.04d0 ! [1/day] Temperature dependent N degradation of extracellular organic N (EON) +pzDia = 1.0d0 !0.5d0 ! Maximum diatom preference ! NEW value for Phaeocystis +sDiaNsq = 0.d0 +pzPhy = 0.5d0 !0.04d0 !0.25d0 !1.0d0 ! Maximum nano-phytoplankton preference (NEW: 3/12) ! NEW value for Phaeocystis +sPhyNsq = 0.d0 +pzCocco = 0.666d0 !0.4d0 ! NEW (8/12) ! NEW value for Phaeocystis +sCoccoNsq = 0.d0 ! NEW +pzPhaeo = 0.5d0 ! NEW for Phaeocystis +sPhaeoNsq = 0.d0 ! NEW for Phaeocystis +pzMicZoo = 1.0d0 ! NEW 3Zoo Maximum nano-phytoplankton preference +sMicZooNsq = 0.d0 ! NEW 3Zoo +tiny_het = 1.d-5 ! for more stable computation of HetRespFlux (_plus). Value can be > tiny because HetRespFlux ~ hetC**2. +/ + +&pasecondzooplankton +graz_max2 = 0.25d0 !0.1d0 ! [mmol N/(m3 * day)] Maximum grazing loss parameter ! NEW value for Phaeocystis +epsilon2 = 0.0144d0 ! [(mmol N)2 /m6] Half saturation constant for grazing loss +res_zoo2 = 0.0107d0 ! [1/day] Respiration by heterotrophs and mortality (loss to detritus) +loss_zoo2 = 0.003d0 ! [1/day] Temperature dependent N degradation of extracellular organic N (EON) +fecal_rate_n = 0.104d0 ! [1/day] Temperature dependent N degradation of \ +fecal_rate_c = 0.236d0 +fecal_rate_n_mes = 0.25d0 ! NEW 3Zoo +fecal_rate_c_mes = 0.32d0 ! NEW 3Zoo +pzDia2 = 1.5d0 !1.0d0 ! Maximum diatom preference ! NEW value for Phaeocystis +sDiaNsq2 = 0.d0 +pzPhy2 = 0.5d0 !0.07d0 ! Maximum diatom preference ! NEW value for Phaeocystis +sPhyNsq2 = 0.d0 +pzCocco2 = 0.5d0 !0.7d0 ! NEW ! NEW value for Phaeocystis +sCoccoNsq2 = 0.d0 ! NEW +pzPhaeo2 = 0.5d0 ! NEW for Phaeocystis +sPhaeoNsq2 = 0.d0 ! NEW for Phaeocystis +pzHet = 1.5d0 !0.8d0 ! Maximum diatom preference +sHetNsq = 0.d0 +pzMicZoo2 = 1.0d0 ! NEW 3Zoo Maximum nano-phytoplankton preference +sMicZooNsq2 = 0.d0 +t1_zoo2 = 28145.d0 ! Krill temp. function constant1 +t2_zoo2 = 272.5d0 ! Krill temp. function constant2 +t3_zoo2 = 105234.d0 ! Krill temp. function constant3 +t4_zoo2 = 274.15d0 ! Krill temp. function constant3 +/ + +&pathirdzooplankton +graz_max3 = 0.36d0 !0.46d0 ! NEW 3Zoo [mmol N/(m3 * day)] Maximum grazing loss parameter ! NEW value for Phaeocystis +epsilon3 = 0.64d0 ! NEW 3Zoo [(mmol N)2 /m6] Half saturation constant for grazing loss +loss_miczoo = 0.01d0 ! NEW 3Zoo [1/day] Temperature dependent N degradation of extracellular organic N (EON) +res_miczoo = 0.01d0 !0.02d0 ! NEW 3Zoo [1/day] Respiration by heterotrophs and mortality (loss to detritus) ! NEW value for Phaeocystis +pzDia3 = 0.5d0 !0.04d0 ! NEW 3Zoo Maximum diatom preference ! NEW value for Phaeocystis +sDiaNsq3 = 0.d0 ! NEW 3Zoo +pzPhy3 = 1.0d0 !0.07d0 ! NEW 3Zoo Maximum nano-phytoplankton preference ! NEW value for Phaeocystis +sPhyNsq3 = 0.d0 ! NEW 3Zoo +pzCocco3 = 0.5d0 !0.7d0 ! NEW 3Zoo Maximum coccolithophore preference ! ATTENTION: This value needs to be tuned; I start with zero preference! ! NEW value for Phaeocystis +sCoccoNsq3 = 0.d0 ! NEW 3Zoo +pzPhaeo3 = 0.25d0 ! NEW for Phaeocystis +sPhaeoNsq3 = 0.d0 ! NEW for Phaeocystis +/ + +&pagrazingdetritus +pzDet = 0.5d0 ! Maximum small detritus prefence by first zooplankton +sDetNsq = 0.d0 +pzDetZ2 = 0.5d0 ! Maximum large detritus preference by first zooplankton +sDetZ2Nsq = 0.d0 +pzDet2 = 0.5d0 ! Maximum small detritus prefence by second zooplankton +sDetNsq2 = 0.d0 +pzDetZ22 = 0.5d0 ! Maximum large detritus preference by second zooplankton +sDetZ2Nsq2 = 0.d0 +/ + +&paaggregation +agg_PD = 0.165d0 ! [m3/(mmol N * day)] Maximum aggregation loss parameter for DetN +agg_PP = 0.015d0 ! [m3/(mmol N * day)] Maximum aggregation loss parameter for PhyN and DiaN (plankton) +/ + +&padin_rho_N +rho_N = 0.11d0 ! [1/day] Temperature dependent N degradation of extracellular organic N (EON) (Remineralization of DON) +/ + +&padic_rho_C1 +rho_C1 = 0.1d0 ! [1/day] Temperature dependent C degradation of extracellular organic C (EOC) +/ + +&paphytoplankton_N +lossN = 0.05d0 ! [1/day] Phytoplankton loss of organic N compounds +lossN_d = 0.05d0 +lossN_c = 0.05d0 ! NEW +lossN_p = 0.05d0 ! NEW for Phaeocystis +/ + +&paphytoplankton_C +lossC = 0.10d0 ! [1/day] Phytoplankton loss of carbon +lossC_d = 0.10d0 +lossC_c = 0.10d0 ! NEW +lossC_p = 0.10d0 ! NEW for Phaeocystis +/ + +&paphytoplankton_ChlA +deg_Chl = 0.15d0 !0.25d0 !0.2d0 ! NEW value for Phaeocystis ! [1/day] +deg_Chl_d = 0.2d0 ! 0.15d0 ! NEW value for Phaeocystis +deg_Chl_c = 0.2d0 ! NEW (has been 0.5) +deg_Chl_p = 0.15d0 ! NEW for Phaeocystis + +/ + +&padetritus_N +gfin = 0.3d0 ! NEW 3Zoo [] Grazing efficiency (fraction of grazing flux into zooplankton pool) +grazEff2 = 0.8d0 ! [] Grazing efficiency (fraction of grazing flux into second zooplankton pool) +grazEff3 = 0.8d0 ! NEW 3Zoo [] Grazing efficiency (fraction of grazing flux into microzooplankton pool) +reminN = 0.165d0 ! [1/day] Temperature dependent remineralisation rate of detritus +/ + +&padetritus_C +reminC = 0.15d0 ! [1/day] Temperature dependent remineralisation rate of detritus +rho_c2 = 0.1d0 ! [1/day] Temperature dependent C degradation of TEP-C +/ + +&paheterotrophs +lossN_z = 0.1d0 +lossC_z = 0.1d0 +/ + +&paseczooloss +lossN_z2 = 0.02d0 +lossC_z2 = 0.02d0 +/ + +&pathirdzooloss +lossN_z3 = 0.05d0 ! NEW 3Zoo +lossC_z3 = 0.05d0 ! NEW 3Zoo +/ + +&paco2lim ! NEW +Cunits = 976.5625 ! Conversion factor between [mol/m3] (model) and [umol/kg] (function): (1000 * 1000) / 1024 +a_co2_phy = 1.162e+00 ! [dimensionless] +a_co2_dia = 1.040e+00 ! [dimensionless] +a_co2_cocco = 1.109e+00 ! [dimensionless] +a_co2_phaeo = 1.162e+00 ! [dimensionless] Phaeocystis +a_co2_calc = 1.102e+00 ! [dimensionless] +b_co2_phy = 4.888e+01 ! [mol/kg] +b_co2_dia = 2.890e+01 ! [mol/kg] +b_co2_cocco = 3.767e+01 ! [mol/kg] +b_co2_phaeo = 4.888e+01 ! [mol/kg] Phaeocystis +b_co2_calc = 4.238e+01 ! [mol/kg] +c_co2_phy = 2.255e-01 ! [kg/mol] +c_co2_dia = 8.778e-01 ! [kg/mol] +c_co2_cocco = 3.912e-01 ! [kg/mol] +c_co2_phaeo = 2.255e-01 ! [kg/mol] Phaeocystis +c_co2_calc = 7.079e-01 ! [kg/mol] +d_co2_phy = 1.023e+07 ! [kg/mol] +d_co2_dia = 2.640e+06 ! [kg/mol] +d_co2_cocco = 9.450e+06 ! [kg/mol] +d_co2_phaeo = 1.023e+07 ! [kg/mol] Phaeocystis +d_co2_calc = 1.343e+07 ! [kg/mol] +/ + +&pairon +Fe2N = 0.033d0 ! Fe2C * 6.625 +Fe2N_benthos = 0.15d0 ! test, default was 0.14 Fe2C_benthos * 6.625 - will have to be tuned. [umol/m2/day] +kScavFe = 0.07d0 +dust_sol = 0.02d0 ! Dissolution of Dust for bioavaliable +RiverFeConc = 100 +/ + +&pacalc +calc_prod_ratio = 0.02 +calc_diss_guts = 0.5d0 !0.0d0 +calc_diss_rate = 0.005714d0 ! 20.d0/3500.d0 +calc_diss_rate2 = 0.005714d0 +calc_diss_omegac = 0.197d0 ! NEW DISS Value from Aumont et al. 2015, will be used with OmegaC_diss flag +calc_diss_exp = 1.d0 ! NEW DISS Exponent in the dissolution rate of calcite, will be used with OmegaC_diss flag +/ + +&pabenthos_decay_rate +decayRateBenN = 0.005d0 +decayRateBenC = 0.005d0 +decayRateBenSi = 0.005d0 +q_NC_Denit = 0.86d0 ! N:C quota of the denitrification process +/ + +&paco2_flux_param +permil = 0.000000976 ! 1.e-3/1024.5d0 ! Converting DIC from [mmol/m3] to [mol/kg] +permeg = 1.e-6 ! [atm/uatm] Changes units from uatm to atm +!X1 = exp(-5.d0*log(10.d0)) ! Lowest ph-value = 7.7 (phlo) +!X2 = exp(-9.d0*log(10.d0)) ! Highest ph-value = 9.5 (phhi) +Xacc = 1.e-12 ! Accuracy for ph-iteration (phacc) +CO2_for_spinup = 278.d0 ! [uatm] Atmospheric partial pressure of CO2 +/ + +&paalkalinity_restoring +surf_relax_Alk = 3.2e-07 !10.d0/31536000.d0 +/ + +&paballasting +rho_POC = 1033.d0 ! kg m-3; density of POC (see Table 1 in Cram et al., 2018) +rho_PON = 1033.d0 ! kg m-3; density of PON (see Table 1 in Cram et al., 2018) +rho_CaCO3 = 2830.d0 ! kg m-3; density of CaCO3 (see Table 1 in Cram et al., 2018) +rho_opal = 2090.d0 ! kg m-3; density of Opal (see Table 1 in Cram et al., 2018) +rho_ref_part = 1230.d0 ! kg m-3; reference particle density (see Cram et al., 2018) +rho_ref_water = 1027.d0 ! kg m-3; reference seawater density (see Cram et al., 2018) +visc_ref_water = 0.00158d0 ! kg m-1 s-1; reference seawater viscosity, at Temp=4 degC (see Cram et al., 2018) +w_ref1 = 10.d0 ! m s-1; reference sinking velocity of small detritus +w_ref2 = 200.d0 ! m s-1; reference sinking velocity of large detritus +depth_scaling1 = 0.01d0 !5d0 ! s-1; factor to increase sinking speed of det1 with depth, set to 0 if not wanted +depth_scaling2 = 0.d0 ! s-1; factor to increase sinking speed of det2 with depth, set to 0 if not wanted +max_sinking_velocity = 250.d0 ! d-1; for numerical stability, set a maximum possible sinking velocity here (applies to both detritus classes) +/ + +&paciso +ciso_init = .false. ! initial fractionation of bulk organic matter +ciso_14 = .false. ! include inorganic radiocarbon +ciso_organic_14 = .false. ! include organic radiocarbon +lambda_14 = 3.8561e-12 ! corresponding to 1 year = 365.00 days +delta_CO2_13 = -6.61 ! atmospheric d13C (permil), global-mean value +big_delta_CO2_14(1) = 0. ! atmospheric D14C (permil), northern hemisphere polewards of 30°N +big_delta_CO2_14(2) = 0. ! atmospheric D14C (permil), (sub) tropical zone 30°N - 30°S +big_delta_CO2_14(3) = 0. ! atmospheric D14C (permil), southern hemisphere polewards of 30°S +atbox_spinup = .false. +cosmic_14_init = 2.0 +/ + diff --git a/config/bin_4p3z2d/namelist.tra b/config/bin_4p3z2d/namelist.tra new file mode 100644 index 000000000..7fd6837a2 --- /dev/null +++ b/config/bin_4p3z2d/namelist.tra @@ -0,0 +1,93 @@ +&tracer_listsize +num_tracers=100 !number of tracers to allocate. shallbe large or equal to the number of streams in &nml_list +/ + +&tracer_list +nml_tracer_list = +1 , 'MFCT', 'QR4C', 'FCT ', 1., 1., +2 , 'MFCT', 'QR4C', 'FCT ', 1., 1., +1001, 'MFCT', 'QR4C', 'FCT ', 1., 1., +1002, 'MFCT', 'QR4C', 'FCT ', 1., 1., +1003, 'MFCT', 'QR4C', 'FCT ', 1., 1., +1004, 'MFCT', 'QR4C', 'FCT ', 1., 1., +1005, 'MFCT', 'QR4C', 'FCT ', 1., 1., +1006, 'MFCT', 'QR4C', 'FCT ', 1., 1., +1007, 'MFCT', 'QR4C', 'FCT ', 1., 1., +1008, 'MFCT', 'QR4C', 'FCT ', 1., 1., +1009, 'MFCT', 'QR4C', 'FCT ', 1., 1., +1010, 'MFCT', 'QR4C', 'FCT ', 1., 1., +1011, 'MFCT', 'QR4C', 'FCT ', 1., 1., +1012, 'MFCT', 'QR4C', 'FCT ', 1., 1., +1013, 'MFCT', 'QR4C', 'FCT ', 1., 1., +1014, 'MFCT', 'QR4C', 'FCT ', 1., 1., +1015, 'MFCT', 'QR4C', 'FCT ', 1., 1., +1016, 'MFCT', 'QR4C', 'FCT ', 1., 1., +1017, 'MFCT', 'QR4C', 'FCT ', 1., 1., +1018, 'MFCT', 'QR4C', 'FCT ', 1., 1., +1019, 'MFCT', 'QR4C', 'FCT ', 1., 1., +1020, 'MFCT', 'QR4C', 'FCT ', 1., 1., +1021, 'MFCT', 'QR4C', 'FCT ', 1., 1., +1022, 'MFCT', 'QR4C', 'FCT ', 1., 1., +1023, 'MFCT', 'QR4C', 'FCT ', 1., 1., +1024, 'MFCT', 'QR4C', 'FCT ', 1., 1., +1025, 'MFCT', 'QR4C', 'FCT ', 1., 1., +1026, 'MFCT', 'QR4C', 'FCT ', 1., 1., +1027, 'MFCT', 'QR4C', 'FCT ', 1., 1., +1028, 'MFCT', 'QR4C', 'FCT ', 1., 1., +1029, 'MFCT', 'QR4C', 'FCT ', 1., 1., +1030, 'MFCT', 'QR4C', 'FCT ', 1., 1., +1031, 'MFCT', 'QR4C', 'FCT ', 1., 1., +1032, 'MFCT', 'QR4C', 'FCT ', 1., 1., +1033, 'MFCT', 'QR4C', 'FCT ', 1., 1., +1034, 'MFCT', 'QR4C', 'FCT ', 1., 1., +1035, 'MFCT', 'QR4C', 'FCT ', 1., 1., +1036, 'MFCT', 'QR4C', 'FCT ', 1., 1., +!101, 'UPW1', 'UPW1', 'NON ', 0., 0. +/ + +&tracer_init3d ! initial conditions for tracers +n_ic3d = 8 ! number of tracers to initialize +idlist = 1019, 1022, 1018, 1003, 1002, 1001, 2, 1 ! their IDs (0 is temperature, 1 is salinity, etc.). The reading order is defined here! +filelist = 'fe_pisces_opa_eq_init_3D_changed_name.nc', 'woa18_all_o00_01_mmol_fesom2.nc', 'woa13_all_i00_01_fesom2.nc', 'GLODAPv2.2016b.TAlk_fesom2_mmol_fix_z_Fillvalue.nc', 'GLODAPv2.2016b.TCO2_fesom2_mmol_fix_z_Fillvalue.nc', 'woa13_all_n00_01_fesom2.nc', 'phc3.0_winter.nc', 'phc3.0_winter.nc' ! list of files in ClimateDataPath to read (one file per tracer), same order as idlist +varlist = 'Fe', 'oxygen_mmol', 'i_an', 'TAlk_mmol', 'TCO2_mmol', 'n_an', 'salt', 'temp' ! variables to read from specified files +t_insitu = .true. ! if T is insitu it will be converted to potential after reading it +/ + +&tracer_init2d ! initial conditions for 2D tracers (sea ice) +n_ic2d = 3 ! number of tracers to initialize +idlist = 1, 2, 3 ! their IDs (0 is a_ice, 1 is m_ice, 3 m_snow). The reading order is defined here! +filelist = 'a_ice.nc', 'm_ice.nc', 'm_snow.nc' ! list of files in ClimateDataPath to read (one file per tracer), same order as idlist +varlist = 'a_ice', 'm_ice', 'm_snow' ! variables to read from specified files +ini_ice_from_file=.false. +/ + +&tracer_general +! bharmonic diffusion for tracers. We recommend to use this option in very high resolution runs (Redi is generally off there). +smooth_bh_tra =.false. ! use biharmonic diffusion (filter implementation) for tracers +gamma0_tra = 0.0005 ! gammaX_tra are analogous to those in the dynamical part +gamma1_tra = 0.0125 +gamma2_tra = 0. +i_vert_diff =.true. +/ + +&tracer_phys +use_momix = .true. ! switch on/off !Monin-Obukhov -> TB04 mixing +momix_lat = -50.0 ! latitidinal treshhold for TB04, =90 --> global +momix_kv = 0.01 ! PP/KPP, mixing coefficient within MO length +use_instabmix = .true. ! enhance convection in case of instable stratification +instabmix_kv = 0.1 +use_windmix = .false. ! enhance mixing trough wind only for PP mixing (for stability) +windmix_kv = 1.e-3 +windmix_nl = 2 +diff_sh_limit=5.0e-3 ! for KPP, max diff due to shear instability +Kv0_const=.true. +double_diffusion=.false. ! for KPP,dd switch +K_ver=1.0e-5 +K_hor=3000. +surf_relax_T=0.0 +surf_relax_S=1.929e-06 ! 50m/300days 6.43e-07! m/s 10./(180.*86400.) +balance_salt_water =.true. ! balance virtual-salt or freshwater flux or not +clim_relax=0.0 ! 1/s, geometrical information has to be supplied +ref_sss_local=.true. +ref_sss=34. +/ diff --git a/config/namelist.io.recom.2p3z2d b/config/namelist.io.recom.2p3z2d new file mode 100644 index 000000000..8381d77c2 --- /dev/null +++ b/config/namelist.io.recom.2p3z2d @@ -0,0 +1,95 @@ +&diag_list +ldiag_solver =.false. +lcurt_stress_surf=.false. +ldiag_curl_vel3 =.false. +ldiag_Ri =.false. +ldiag_turbflux =.false. +ldiag_salt3D =.false. +ldiag_dMOC =.false. +ldiag_DVD =.false. +ldiag_forc =.false. +ldiag_extflds =.false. +ldiag_destine =.false. +ldiag_trflx =.false. +ldiag_uvw_sqr =.false. +ldiag_trgrd_xyz =.false. +/ + +&nml_general +io_listsize =150 !number of streams to allocate. shallbe large or equal to the number of streams in &nml_list +vec_autorotate =.false. +compression_level = 1 +/ + +! for sea ice related variables use_ice should be true, otherewise there will be no output +! for 'curl_surf' to work lcurt_stress_surf must be .true. otherwise no output +! for 'fer_C', 'bolus_u', 'bolus_v', 'bolus_w', 'fer_K' to work Fer_GM must be .true. otherwise no output +! 'otracers' - all other tracers if applicable +! for 'dMOC' to work ldiag_dMOC must be .true. otherwise no output +&nml_list +io_list = 'sst ',1, 'm', 4, + 'sss ',1, 'm', 4, + 'ssh ',1, 'm', 4, + 'uice ',1, 'm', 4, + 'vice ',1, 'm', 4, + 'a_ice ',1, 'm', 4, + 'm_ice ',1, 'm', 4, + 'm_snow ',1, 'm', 4, + 'MLD1 ',1, 'm', 4, + 'MLD2 ',1, 'm', 4, + 'MLD3 ',1, 'm', 4, + 'tx_sur ',1, 'm', 4, + 'ty_sur ',1, 'm', 4, + 'prec ',1, 'm', 4, + 'snow ',1, 'm', 4, + 'evap ',1, 'm', 4, + 'runoff ',1, 'm', 4, + 'temp ',1, 'm', 4, + 'salt ',1, 'm', 8, + 'otracers ',1, 'm', 4, + 'N2 ',1, 'y', 4, + 'Kv ',1, 'y', 4, + 'u ',1, 'm', 4, + 'v ',1, 'm', 4, + 'unod ',1, 'm', 4, + 'vnod ',1, 'm', 4, + 'w ',1, 'm', 4, + 'Av ',1, 'y', 4, + 'bolus_u ',1, 'y', 4, + 'bolus_v ',1, 'y', 4, + 'bolus_w ',1, 'y', 4, + 'fw ',1, 'm', 4, + 'fh ',1, 'm', 4, + 'dpCO2s ',1, 'm', 4, + 'pCO2s ',1, 'm', 4, + 'CO2f ',1, 'm', 4, + 'xCO2atm ',4, 's', 4, + 'Hp ',1, 'm', 4, + 'aFe ',1, 'm', 4, + 'aN ',1, 'm', 4, + 'denb ',1, 'm', 4, + 'benN ',1, 'm', 4, + 'benC ',1, 'm', 4, + 'benSi ',1, 'm', 4, + 'benCalc ',1, 'm', 4, + 'Chldegd ',1, 'm', 4, + 'Chldegn ',1, 'm', 4, + 'NNAd ',1, 'm', 4, + 'NNAn ',1, 'm', 4, + 'GPPd ',1, 'm', 4, + 'GPPn ',1, 'm', 4, + 'NPPd ',1, 'm', 4, + 'NPPn ',1, 'm', 4, + 'PAR ',1, 'm', 4, + 'respmeso',1, 'm', 4, + 'respmacro',1, 'm', 4, + 'respmicro',1, 'm', 4, + 'calcdiss',1, 'm', 4, + 'calcif',1, 'm', 4, + 'aggn',1, 'm', 4, + 'aggd',1, 'm', 4, + 'docexn',1, 'm', 4, + 'docexd',1, 'm', 4, + 'respn',1, 'm', 4, + 'respd',1, 'm', 4, +/ diff --git a/config/namelist.recom.2p3z2d b/config/namelist.recom.2p3z2d new file mode 100644 index 000000000..5d18e9295 --- /dev/null +++ b/config/namelist.recom.2p3z2d @@ -0,0 +1,355 @@ +! This is the namelist file for recom + +&nam_rsbc +fe_data_source ='Albani' +nm_fe_data_file ='/albedo/work/projects/p_pool_recom/input/mesh_CORE2_finaltopo_mean/DustClimMonthlyAlbani.nc' +nm_aen_data_file ='/albedo/work/projects/p_pool_recom/input/mesh_CORE2_finaltopo_mean/AeolianNitrogenDep.nc' +nm_river_data_file ='/albedo/work/projects/p_pool_recom/input/mesh_CORE2_finaltopo_mean/RiverineInput.nc' +nm_erosion_data_file ='/albedo/work/projects/p_pool_recom/input/mesh_CORE2_finaltopo_mean/ErosionInput.nc' +nm_co2_data_file ='/albedo/work/projects/p_pool_recom/input/mesh_CORE2_finaltopo_mean/MonthlyAtmCO2_gcb2023.nc' +/ + +&pavariables +use_REcoM =.true. +REcoM_restart =.true. + +bgc_num = 30 !22 !33 !24 !38 +diags3d_num = 28 ! Number of diagnostic 3d tracers to be saved +bgc_base_num = 22 ! standard tracers +VDet = 20.d0 ! Sinking velocity, constant through the water column and positive downwards +VDet_zoo2 = 200.d0 ! Sinking velocity, constant through the water column +VPhy = 0.d0 !!! If the number of sinking velocities are different from 3, code needs to be changed !!! +VDia = 0.d0 +VCocco = 0.d0 +allow_var_sinking = .true. +biostep = 1 ! Number of times biology should be stepped forward for each time step +REcoM_Geider_limiter = .false. ! Decides what routine should be used to calculate limiters in sms +REcoM_Grazing_Variable_Preference = .true. ! Decides if grazing should have preference for phyN or DiaN +Grazing_detritus = .true. +het_resp_noredfield = .true. ! Decides respiratation of copepod group +diatom_mucus = .true. ! Decides nutrient limitation effect on aggregation +O2dep_remin = .false. ! O2remin Add option for O2 dependency of organic matter remineralization +use_ballasting = .false. ! BALL +use_density_scaling = .false. ! BALL +use_viscosity_scaling = .false. ! BALL +OmegaC_diss = .false. ! DISS Use OmegaC from Mocsy to compute calcite dissolution (after Aumont et al. 2015 and Gehlen et al. 2007) +CO2lim = .false. ! CO2 dependence of growth and calcification +Diags = .true. +constant_CO2 = .true. +UseFeDust = .true. ! Turns dust input of iron off when set to.false. +UseDustClim = .true. +UseDustClimAlbani = .true. ! Use Albani dustclim field (If it is false Mahowald will be used) +use_photodamage = .true. ! use Alvarez et al (2018) for chlorophyll degradation +HetRespFlux_plus = .true. !MB More stable computation of zooplankton respiration fluxes adding a small number to HetN +REcoMDataPath = '/albedo/work/projects/MarESys/ogurses/input/mesh_CORE2_finaltopo_mean/' +restore_alkalinity = .true. +useRivers = .false. +useRivFe = .false. ! When set to true, riverine Fe source is activated +useErosion = .false. +NitrogenSS = .false. ! When set to true, external sources and sinks of nitrogen are activated (Riverine, aeolian and denitrification) +useAeolianN = .false. ! When set to true, aeolian nitrogen deposition is activated +firstyearoffesomcycle = 1958 ! The first year of the actual physical forcing (e.g. JRA-55) used +lastyearoffesomcycle = 2024 ! Last year of the actual physical forcing used +numofCO2cycles = 1 ! Number of cycles of the forcing planned +currentCO2cycle = 1 ! Which CO2 cycle we are currently running +DIC_PI = .true. +Nmocsy = 1 ! Length of the vector that is passed to mocsy (always one for recom) +recom_debug =.false. +ciso =.false. ! Main switch to enable/disable carbon isotopes (13|14C) +benthos_num = 4 ! number of benthic BGC tracers -> 8 if (ciso == .true.) otherwise -> 4 +use_MEDUSA = .false. ! Main switch for the sediment model MEDUSA +sedflx_num = 0 ! if 0: no file from MEDUSA is read but default sediment +bottflx_num = 4 ! if ciso&ciso_14: =8; if .not.ciso_14: =6; no ciso: =4 +use_atbox = .false. +add_loopback = .false. ! add loopback fluxes through rivers to the surface +lb_tscale = 1.0 ! /year: fraction of loopback fluxes yearly added to the surface +/ + +&pasinking +Vdet_a = 0.0288 ! [1/day] +Vcalc = 0.0144 ! [1/day] +/ + +&painitialization_N +cPhyN = 0.2d0 +cHetN = 0.2d0 +cZoo2N = 0.2d0 +/ + +&paArrhenius +recom_Tref = 288.15d0 ! [K] +C2K = 273.15d0 ! Conversion from degrees C to K +Ae = 4500.d0 ! [K] Slope of the linear part of the Arrhenius function +reminSi = 0.02d0 +k_o2_remin = 15.d0 ! NEW O2remin mmol m-3; Table 1 in Cram 2018 cites DeVries & Weber 2017 for a range of 0-30 mmol m-3 +/ + +&palimiter_function +NMinSlope = 50.d0 +SiMinSlope = 1000.d0 +NCmin = 0.04d0 !0.05d0 +NCmin_d = 0.04d0 !0.05d0 +NCmin_c = 0.04d0 ! NEW +SiCmin = 0.04d0 +k_Fe = 0.04d0 +k_Fe_d = 0.12d0 +k_Fe_c = 0.09d0 ! NEW +k_si = 4.d0 +P_cm = 3.0d0 ! [1/day] Rate of C-specific photosynthesis +P_cm_d = 3.5d0 +P_cm_c = 2.8d0 ! NEW +/ + +&palight_calculations +k_w = 0.04d0 ! [1/m] Light attenuation coefficient +a_chl = 0.03d0 ! [1/m * 1/(mg Chl)] Chlorophyll specific attenuation coefficients +/ + +&paphotosynthesis +alfa = 0.14d0 ! [(mmol C*m2)/(mg Chl*W*day)] +alfa_d = 0.19d0 ! An initial slope of the P-I curve +alfa_c = 0.10d0 ! NEW +parFrac = 0.43d0 +/ + +&paassimilation +V_cm_fact = 0.7d0 ! scaling factor for temperature dependent maximum of C-specific N-uptake +V_cm_fact_d = 0.7d0 +V_cm_fact_c = 0.7d0 ! NEW +NMaxSlope = 1000.d0 ! Max slope for limiting function +SiMaxSlope = 1000.d0 +NCmax = 0.2d0 ! [mmol N/mmol C] Maximum cell quota of nitrogen (N:C) +NCmax_d = 0.2d0 +NCmax_c = 0.15d0 ! NEW +SiCmax = 0.8d0 +NCuptakeRatio = 0.2d0 ! [mmol N/mmol C] Maximum uptake ratio of N:C +NCUptakeRatio_d = 0.2d0 +NCUptakeRatio_c = 0.2d0 ! NEW +SiCUptakeRatio = 0.2d0 +k_din = 0.55d0 ! [mmol N/m3] Half-saturation constant for nitrate uptake +k_din_d = 1.0d0 +k_din_c = 0.9d0 ! NEW +Chl2N_max = 3.15d0 ! [mg CHL/mmol N] Maximum CHL a : N ratio = 0.3 gCHL gN^-1 +Chl2N_max_d = 4.2d0 +Chl2N_max_c = 3.5d0 ! NEW +res_phy = 0.01d0 ! [1/day] Maintenance respiration rate constant +res_phy_d = 0.01d0 +res_phy_c = 0.01d0 ! NEW +biosynth = 2.33d0 ! [mmol C/mmol N] Cost of biosynthesis +biosynthSi = 0.d0 +/ + +&pairon_chem +totalligand = 1.d0 ! [mumol/m3] order 1. Total free ligand +ligandStabConst = 100.d0 ! [m3/mumol] order 100. Ligand-free iron stability constant +/ + +&pazooplankton +graz_max = 0.31d0 ! [mmol N/(m3 * day)] Maximum grazing loss parameter +epsilonr = 0.09d0 ! [(mmol N)2 /m6] Half saturation constant for grazing loss +res_het = 0.028d0 ! [1/day] Respiration by heterotrophs and mortality (loss to detritus) +Redfield = 6.625 ! [mmol C/mmol N] Redfield ratio of C:N = 106:16 +loss_het = 0.04d0 ! [1/day] Temperature dependent N degradation of extracellular organic N (EON) +pzDia = 1.0d0 !0.5d0 ! Maximum diatom preference +sDiaNsq = 0.d0 +pzPhy = 0.5d0 !0.25d0 !1.0d0 ! Maximum nano-phytoplankton preference (NEW: 3/12) +sPhyNsq = 0.d0 +pzCocco = 0.666d0 ! NEW (8/12) +sCoccoNsq = 0.d0 ! NEW +pzMicZoo = 1.0d0 ! NEW 3Zoo Maximum nano-phytoplankton preference +sMicZooNsq = 0.d0 ! NEW 3Zoo +tiny_het = 1.d-5 ! for more stable computation of HetRespFlux (_plus). Value can be > tiny because HetRespFlux ~ hetC**2. +/ + +&pasecondzooplankton +graz_max2 = 0.1d0 ! [mmol N/(m3 * day)] Maximum grazing loss parameter +epsilon2 = 0.0144d0 ! [(mmol N)2 /m6] Half saturation constant for grazing loss +res_zoo2 = 0.0107d0 ! [1/day] Respiration by heterotrophs and mortality (loss to detritus) +loss_zoo2 = 0.003d0 ! [1/day] Temperature dependent N degradation of extracellular organic N (EON) +fecal_rate_n = 0.104d0 ! [1/day] Temperature dependent N degradation of \ +fecal_rate_c = 0.236d0 +fecal_rate_n_mes = 0.25d0 ! NEW 3Zoo +fecal_rate_c_mes = 0.32d0 ! NEW 3Zoo +pzDia2 = 1.5d0 !1.d0 ! Maximum diatom preference +sDiaNsq2 = 0.d0 +pzPhy2 = 0.5d0 ! Maximum diatom preference +sPhyNsq2 = 0.d0 +pzCocco2 = 0.5d0 ! NEW +sCoccoNsq2 = 0.d0 ! NEW +pzHet = 1.5d0 !0.8d0 ! Maximum diatom preference +sHetNsq = 0.d0 +pzMicZoo2 = 1.0d0 ! NEW 3Zoo Maximum nano-phytoplankton preference +sMicZooNsq2 = 0.d0 +t1_zoo2 = 28145.d0 ! Krill temp. function constant1 +t2_zoo2 = 272.5d0 ! Krill temp. function constant2 +t3_zoo2 = 105234.d0 ! Krill temp. function constant3 +t4_zoo2 = 274.15d0 ! Krill temp. function constant3 +/ + +&pathirdzooplankton +graz_max3 = 0.46d0 ! NEW 3Zoo [mmol N/(m3 * day)] Maximum grazing loss parameter +epsilon3 = 0.64d0 ! NEW 3Zoo [(mmol N)2 /m6] Half saturation constant for grazing loss +loss_miczoo = 0.01d0 ! NEW 3Zoo [1/day] Temperature dependent N degradation of extracellular organic N (EON) +res_miczoo = 0.01d0 ! NEW 3Zoo [1/day] Respiration by heterotrophs and mortality (loss to detritus) +pzDia3 = 0.5d0 ! NEW 3Zoo Maximum diatom preference +sDiaNsq3 = 0.d0 ! NEW 3Zoo +pzPhy3 = 1.0d0 ! NEW 3Zoo Maximum nano-phytoplankton preference +sPhyNsq3 = 0.d0 ! NEW 3Zoo +pzCocco3 = 0.d0 ! NEW 3Zoo Maximum coccolithophore preference ! ATTENTION: This value needs to be tuned; I start with zero preference! +sCoccoNsq3 = 0.d0 ! NEW 3Zoo +/ + +&pagrazingdetritus +pzDet = 0.5d0 ! Maximum small detritus prefence by first zooplankton +sDetNsq = 0.d0 +pzDetZ2 = 0.5d0 ! Maximum large detritus preference by first zooplankton +sDetZ2Nsq = 0.d0 +pzDet2 = 0.5d0 ! Maximum small detritus prefence by second zooplankton +sDetNsq2 = 0.d0 +pzDetZ22 = 0.5d0 ! Maximum large detritus preference by second zooplankton +sDetZ2Nsq2 = 0.d0 +/ + +&paaggregation +agg_PD = 0.165d0 ! [m3/(mmol N * day)] Maximum aggregation loss parameter for DetN +agg_PP = 0.015d0 ! [m3/(mmol N * day)] Maximum aggregation loss parameter for PhyN and DiaN (plankton) +/ + +&padin_rho_N +rho_N = 0.11d0 ! [1/day] Temperature dependent N degradation of extracellular organic N (EON) (Remineralization of DON) +/ + +&padic_rho_C1 +rho_C1 = 0.1d0 ! [1/day] Temperature dependent C degradation of extracellular organic C (EOC) +/ + +&paphytoplankton_N +lossN = 0.05d0 ! [1/day] Phytoplankton loss of organic N compounds +lossN_d = 0.05d0 +lossN_c = 0.05d0 ! NEW +/ + +&paphytoplankton_C +lossC = 0.10d0 ! [1/day] Phytoplankton loss of carbon +lossC_d = 0.10d0 +lossC_c = 0.10d0 ! NEW +/ + +&paphytoplankton_ChlA +deg_Chl = 0.25d0 !0.2d0 !0.25d0 ! [1/day] +deg_Chl_d = 0.15d0 !0.2d0 !0.15d0 +deg_Chl_c = 0.2d0 ! NEW (has been 0.5) +/ + +&padetritus_N +gfin = 0.3d0 ! NEW 3Zoo [] Grazing efficiency (fraction of grazing flux into zooplankton pool) +grazEff2 = 0.8d0 ! [] Grazing efficiency (fraction of grazing flux into second zooplankton pool) +grazEff3 = 0.8d0 ! NEW 3Zoo [] Grazing efficiency (fraction of grazing flux into microzooplankton pool) +reminN = 0.165d0 ! [1/day] Temperature dependent remineralisation rate of detritus +/ + +&padetritus_C +reminC = 0.15d0 ! [1/day] Temperature dependent remineralisation rate of detritus +rho_c2 = 0.1d0 ! [1/day] Temperature dependent C degradation of TEP-C +/ + +&paheterotrophs +lossN_z = 0.1d0 +lossC_z = 0.1d0 +/ + +&paseczooloss +lossN_z2 = 0.02d0 +lossC_z2 = 0.02d0 +/ + +&pathirdzooloss +lossN_z3 = 0.05d0 ! NEW 3Zoo +lossC_z3 = 0.05d0 ! NEW 3Zoo +/ + +&paco2lim ! NEW +Cunits = 976.5625 ! Conversion factor between [mol/m3] (model) and [umol/kg] (function): (1000 * 1000) / 1024 +a_co2_phy = 1.162e+00 ! [dimensionless] +a_co2_dia = 1.040e+00 ! [dimensionless] +a_co2_cocco = 1.109e+00 ! [dimensionless] +a_co2_calc = 1.102e+00 ! [dimensionless] +b_co2_phy = 4.888e+01 ! [mol/kg] +b_co2_dia = 2.890e+01 ! [mol/kg] +b_co2_cocco = 3.767e+01 ! [mol/kg] +b_co2_calc = 4.238e+01 ! [mol/kg] +c_co2_phy = 2.255e-01 ! [kg/mol] +c_co2_dia = 8.778e-01 ! [kg/mol] +c_co2_cocco = 3.912e-01 ! [kg/mol] +c_co2_calc = 7.079e-01 ! [kg/mol] +d_co2_phy = 1.023e+07 ! [kg/mol] +d_co2_dia = 2.640e+06 ! [kg/mol] +d_co2_cocco = 9.450e+06 ! [kg/mol] +d_co2_calc = 1.343e+07 ! [kg/mol] +/ + +&pairon +Fe2N = 0.033d0 ! Fe2C * 6.625 +Fe2N_benthos = 0.15d0 ! test, default was 0.14 Fe2C_benthos * 6.625 - will have to be tuned. [umol/m2/day] +kScavFe = 0.07d0 +dust_sol = 0.02d0 ! Dissolution of Dust for bioavaliable +RiverFeConc = 100 +/ + +&pacalc +calc_prod_ratio = 0.02 +calc_diss_guts = 0.0d0 +calc_diss_rate = 0.005714 ! 20.d0/3500.d0 +calc_diss_rate2 = 0.005714d0 +calc_diss_omegac = 0.197d0 ! NEW DISS Value from Aumont et al. 2015, will be used with OmegaC_diss flag +calc_diss_exp = 1.d0 ! NEW DISS Exponent in the dissolution rate of calcite, will be used with OmegaC_diss flag +/ + +&pabenthos_decay_rate +decayRateBenN = 0.005d0 +decayRateBenC = 0.005d0 +decayRateBenSi = 0.005d0 +q_NC_Denit = 0.86d0 ! N:C quota of the denitrification process +/ + +&paco2_flux_param +permil = 0.000000976 ! 1.e-3/1024.5d0 ! Converting DIC from [mmol/m3] to [mol/kg] +permeg = 1.e-6 ! [atm/uatm] Changes units from uatm to atm +!X1 = exp(-5.d0*log(10.d0)) ! Lowest ph-value = 7.7 (phlo) +!X2 = exp(-9.d0*log(10.d0)) ! Highest ph-value = 9.5 (phhi) +Xacc = 1.e-12 ! Accuracy for ph-iteration (phacc) +CO2_for_spinup = 278.d0 ! [uatm] Atmospheric partial pressure of CO2 +/ + +&paalkalinity_restoring +surf_relax_Alk = 3.2e-07 !10.d0/31536000.d0 +/ + +&paballasting +rho_POC = 1033.d0 ! kg m-3; density of POC (see Table 1 in Cram et al., 2018) +rho_PON = 1033.d0 ! kg m-3; density of PON (see Table 1 in Cram et al., 2018) +rho_CaCO3 = 2830.d0 ! kg m-3; density of CaCO3 (see Table 1 in Cram et al., 2018) +rho_opal = 2090.d0 ! kg m-3; density of Opal (see Table 1 in Cram et al., 2018) +rho_ref_part = 1230.d0 ! kg m-3; reference particle density (see Cram et al., 2018) +rho_ref_water = 1027.d0 ! kg m-3; reference seawater density (see Cram et al., 2018) +visc_ref_water = 0.00158d0 ! kg m-1 s-1; reference seawater viscosity, at Temp=4 degC (see Cram et al., 2018) +w_ref1 = 10.d0 ! m s-1; reference sinking velocity of small detritus +w_ref2 = 200.d0 ! m s-1; reference sinking velocity of large detritus +depth_scaling1 = 0.015d0 ! s-1; factor to increase sinking speed of det1 with depth, set to 0 if not wanted +depth_scaling2 = 0.d0 ! s-1; factor to increase sinking speed of det2 with depth, set to 0 if not wanted +max_sinking_velocity = 250.d0 ! d-1; for numerical stability, set a maximum possible sinking velocity here (applies to both detritus classes) +/ + +&paciso +ciso_init = .false. ! initial fractionation of bulk organic matter +ciso_14 = .false. ! include inorganic radiocarbon +ciso_organic_14 = .false. ! include organic radiocarbon +lambda_14 = 3.8561e-12 ! corresponding to 1 year = 365.00 days +delta_CO2_13 = -6.61 ! atmospheric d13C (permil), global-mean value +big_delta_CO2_14(1) = 0. ! atmospheric D14C (permil), northern hemisphere polewards of 30°N +big_delta_CO2_14(2) = 0. ! atmospheric D14C (permil), (sub) tropical zone 30°N - 30°S +big_delta_CO2_14(3) = 0. ! atmospheric D14C (permil), southern hemisphere polewards of 30°S +atbox_spinup = .false. +cosmic_14_init = 2.0 +/ + diff --git a/config/namelist.tra.recom.2p3z2d b/config/namelist.tra.recom.2p3z2d new file mode 100644 index 000000000..d1733bb91 --- /dev/null +++ b/config/namelist.tra.recom.2p3z2d @@ -0,0 +1,90 @@ +&tracer_listsize +num_tracers=100 !number of tracers to allocate. shallbe large or equal to the number of streams in &nml_list +/ + +&tracer_list +nml_tracer_list = +1 , 'MFCT', 'QR4C', 'FCT ', 1., 1., +2 , 'MFCT', 'QR4C', 'FCT ', 1., 1., +1001, 'MFCT', 'QR4C', 'FCT ', 1., 1., +1002, 'MFCT', 'QR4C', 'FCT ', 1., 1., +1003, 'MFCT', 'QR4C', 'FCT ', 1., 1., +1004, 'MFCT', 'QR4C', 'FCT ', 1., 1., +1005, 'MFCT', 'QR4C', 'FCT ', 1., 1., +1006, 'MFCT', 'QR4C', 'FCT ', 1., 1., +1007, 'MFCT', 'QR4C', 'FCT ', 1., 1., +1008, 'MFCT', 'QR4C', 'FCT ', 1., 1., +1009, 'MFCT', 'QR4C', 'FCT ', 1., 1., +1010, 'MFCT', 'QR4C', 'FCT ', 1., 1., +1011, 'MFCT', 'QR4C', 'FCT ', 1., 1., +1012, 'MFCT', 'QR4C', 'FCT ', 1., 1., +1013, 'MFCT', 'QR4C', 'FCT ', 1., 1., +1014, 'MFCT', 'QR4C', 'FCT ', 1., 1., +1015, 'MFCT', 'QR4C', 'FCT ', 1., 1., +1016, 'MFCT', 'QR4C', 'FCT ', 1., 1., +1017, 'MFCT', 'QR4C', 'FCT ', 1., 1., +1018, 'MFCT', 'QR4C', 'FCT ', 1., 1., +1019, 'MFCT', 'QR4C', 'FCT ', 1., 1., +1020, 'MFCT', 'QR4C', 'FCT ', 1., 1., +1021, 'MFCT', 'QR4C', 'FCT ', 1., 1., +1022, 'MFCT', 'QR4C', 'FCT ', 1., 1., +1023, 'MFCT', 'QR4C', 'FCT ', 1., 1., +1024, 'MFCT', 'QR4C', 'FCT ', 1., 1., +1025, 'MFCT', 'QR4C', 'FCT ', 1., 1., +1026, 'MFCT', 'QR4C', 'FCT ', 1., 1., +1027, 'MFCT', 'QR4C', 'FCT ', 1., 1., +1028, 'MFCT', 'QR4C', 'FCT ', 1., 1., +1029, 'MFCT', 'QR4C', 'FCT ', 1., 1., +1030, 'MFCT', 'QR4C', 'FCT ', 1., 1., +!1031, 'MFCT', 'QR4C', 'FCT ', 1., 1., +!1032, 'MFCT', 'QR4C', 'FCT ', 1., 1., +!1033, 'MFCT', 'QR4C', 'FCT ', 1., 1., +!101, 'UPW1', 'UPW1', 'NON ', 0., 0. +/ + +&tracer_init3d ! initial conditions for tracers +n_ic3d = 8 ! number of tracers to initialize +idlist = 1019, 1022, 1018, 1003, 1002, 1001, 2, 1 ! their IDs (0 is temperature, 1 is salinity, etc.). The reading order is defined here! +filelist = 'fe_pisces_opa_eq_init_3D_changed_name.nc', 'woa18_all_o00_01_mmol_fesom2.nc', 'woa13_all_i00_01_fesom2.nc', 'GLODAPv2.2016b.TAlk_fesom2_mmol_fix_z_Fillvalue.nc', 'GLODAPv2.2016b.TCO2_fesom2_mmol_fix_z_Fillvalue.nc', 'woa13_all_n00_01_fesom2.nc', 'phc3.0_winter.nc', 'phc3.0_winter.nc' ! list of files in ClimateDataPath to read (one file per tracer), same order as idlist +varlist = 'Fe', 'oxygen_mmol', 'i_an', 'TAlk_mmol', 'TCO2_mmol', 'n_an', 'salt', 'temp' ! variables to read from specified files +t_insitu = .true. ! if T is insitu it will be converted to potential after reading it +/ + +&tracer_init2d ! initial conditions for 2D tracers (sea ice) +n_ic2d = 3 ! number of tracers to initialize +idlist = 1, 2, 3 ! their IDs (0 is a_ice, 1 is m_ice, 3 m_snow). The reading order is defined here! +filelist = 'a_ice.nc', 'm_ice.nc', 'm_snow.nc' ! list of files in ClimateDataPath to read (one file per tracer), same order as idlist +varlist = 'a_ice', 'm_ice', 'm_snow' ! variables to read from specified files +ini_ice_from_file=.false. +/ + +&tracer_general +! bharmonic diffusion for tracers. We recommend to use this option in very high resolution runs (Redi is generally off there). +smooth_bh_tra =.false. ! use biharmonic diffusion (filter implementation) for tracers +gamma0_tra = 0.0005 ! gammaX_tra are analogous to those in the dynamical part +gamma1_tra = 0.0125 +gamma2_tra = 0. +i_vert_diff =.true. +/ + +&tracer_phys +use_momix = .true. ! switch on/off !Monin-Obukhov -> TB04 mixing +momix_lat = -50.0 ! latitidinal treshhold for TB04, =90 --> global +momix_kv = 0.01 ! PP/KPP, mixing coefficient within MO length +use_instabmix = .true. ! enhance convection in case of instable stratification +instabmix_kv = 0.1 +use_windmix = .false. ! enhance mixing trough wind only for PP mixing (for stability) +windmix_kv = 1.e-3 +windmix_nl = 2 +diff_sh_limit=5.0e-3 ! for KPP, max diff due to shear instability +Kv0_const=.true. +double_diffusion=.false. ! for KPP,dd switch +K_ver=1.0e-5 +K_hor=3000. +surf_relax_T=0.0 +surf_relax_S=1.929e-06 ! 50m/300days 6.43e-07! m/s 10./(180.*86400.) +balance_salt_water =.true. ! balance virtual-salt or freshwater flux or not +clim_relax=0.0 ! 1/s, geometrical information has to be supplied +ref_sss_local=.true. +ref_sss=34. +/ diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 65817d890..012e7bde2 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -71,6 +71,9 @@ if(${ENABLE_OPENMP}) find_package(OpenMP REQUIRED COMPONENTS Fortran) endif() +option(RECOM_COUPLED "Use RECOM" OFF) +message(STATUS "RECOM_COUPLED: ${RECOM_COUPLED}") + option(USE_ICEPACK "Use ICEPACK" OFF) message(STATUS "USE_ICEPACK: ${USE_ICEPACK}") @@ -310,7 +313,7 @@ if(OPENMP_REPRODUCIBLE) endif() if(${RECOM_COUPLED}) - target_compile_definitions(${PROJECT_NAME} PRIVATE __recom USE_PRECISION=2 __3Zoo2Det __coccos)# __usetp) + target_compile_definitions(${PROJECT_NAME} PRIVATE __recom USE_PRECISION=2 __3Zoo2Det)# __usetp) endif() if(${CISO_COUPLED}) diff --git a/src/MOD_TRACER.F90 b/src/MOD_TRACER.F90 index efeeed623..d1b872a18 100644 --- a/src/MOD_TRACER.F90 +++ b/src/MOD_TRACER.F90 @@ -20,6 +20,9 @@ MODULE MOD_TRACER real(kind=WP) :: tra_adv_pv = 1. ! a parameter to be used in horizontal advection (for QR4C it is the fraction of fourth-order contribution in the solution) integer :: AB_order=2 integer :: ID +!___________________________________________________________________________ +! TODO: Make it as a part of namelist.tra +logical :: ltra_diag = .true. ! OG - tra_diag contains procedure WRITE_T_TRACER_DATA @@ -41,7 +44,14 @@ MODULE MOD_TRACER ! compute Tstar = 0.5*( T^(n+1) + T^n) real(kind=WP), allocatable, dimension(:,:,:) :: dvd_trflx_hor, dvd_trflx_ver -!_______________________________________________________________________________ +! in case ltra_diag=.true. --> calculate tracer diags ! OG - tra_diag +real(kind=WP), allocatable :: tra_advhoriz(:,:,:), tra_advvert(:,:,:) +real(kind=WP), allocatable :: tra_diff_part_hor_redi(:,:,:) +real(kind=WP), allocatable :: tra_diff_part_ver_expl(:,:,:) +real(kind=WP), allocatable :: tra_diff_part_ver_redi_expl(:,:,:) +real(kind=WP), allocatable :: tra_diff_part_ver_impl(:,:,:) +real(kind=WP), allocatable :: tra_recom_sms(:,:,:) + ! The fct part real(kind=WP),allocatable,dimension(:,:) :: fct_LO ! Low-order solution real(kind=WP),allocatable,dimension(:,:) :: adv_flux_hor ! Antidif. horiz. contrib. from edges / backup for iterafive fct scheme diff --git a/src/cpl_driver.F90 b/src/cpl_driver.F90 index d5ab69c69..1f0ffc44c 100644 --- a/src/cpl_driver.F90 +++ b/src/cpl_driver.F90 @@ -17,6 +17,8 @@ module cpl_driver use o_param, only : rad USE MOD_PARTIT use mpi + + implicit none save ! @@ -28,8 +30,15 @@ module cpl_driver ! (final number of fields depends now on lwiso switch and is set in subroutine cpl_oasis3mct_define_unstr) #if defined (__oifs) +#if defined(__recom) + integer :: nsend = 8 + integer :: nrecv = 16 +!With oifs, without recom: +#else integer :: nsend = 7 integer :: nrecv = 15 +#endif +!Without oifs #else integer :: nsend = 4 integer :: nrecv = 12 @@ -658,6 +667,9 @@ subroutine cpl_oasis3mct_define_unstr(partit, mesh) cpl_send( 5)='sia_feom' ! 5. sea ice albedo [%-100] -> cpl_send( 6)='u_feom' ! 6. eastward surface velocity [m/s] -> cpl_send( 7)='v_feom' ! 7. northward surface velocity [m/s] -> +#if defined (__recom) + cpl_send( 8)='FCO2_feom'! 8. CO2 flux [kgCO2 m-2 s-1] -> +#endif #else cpl_send( 1)='sst_feom' ! 1. sea surface temperature [°C] -> cpl_send( 2)='sit_feom' ! 2. sea ice thickness [m] -> @@ -698,6 +710,10 @@ subroutine cpl_oasis3mct_define_unstr(partit, mesh) cpl_recv(13) = 'calv_oce' cpl_recv(14) = 'u10w_oce' cpl_recv(15) = 'v10w_oce' +#if defined (__recom) + cpl_recv(16) = 'XCO2_oce' +#endif +!Not oifs #else cpl_recv(1) = 'taux_oce' cpl_recv(2) = 'tauy_oce' diff --git a/src/fesom_module.F90 b/src/fesom_module.F90 index 50e379133..7ecc72a3c 100755 --- a/src/fesom_module.F90 +++ b/src/fesom_module.F90 @@ -38,6 +38,7 @@ module fesom_main_storage_module use iceberg_step use iceberg_ocean_coupling use Toy_Channel_Soufflet, only: compute_zonal_mean + use ieee_arithmetic ! Define icepack module #if defined (__icepack) diff --git a/src/gen_events.F90 b/src/gen_events.F90 index ee639a608..23a5a646b 100644 --- a/src/gen_events.F90 +++ b/src/gen_events.F90 @@ -8,8 +8,10 @@ subroutine annual_event(do_output, N) logical, intent(inout) :: do_output integer, intent(in) :: N + integer :: elapsed_years - if (mod(yearnew, N)==0 .and. (daynew == ndpyr) .and. (timenew==86400.)) then + elapsed_years = yearnew - yearstart + 1 + if (mod(elapsed_years, N)==0 .and. (daynew == ndpyr) .and. (timenew==86400.)) then do_output=.true. else do_output=.false. diff --git a/src/gen_forcing_couple.F90 b/src/gen_forcing_couple.F90 index bf14ac11e..a83c82f31 100755 --- a/src/gen_forcing_couple.F90 +++ b/src/gen_forcing_couple.F90 @@ -98,6 +98,9 @@ subroutine update_atm_forcing(istep, ice, tracers, dynamics, partit, mesh) #endif use gen_bulk use force_flux_consv_interface +#if defined (__recom) + use REcoM_GloVar, only: x_co2atm, GloCO2flux_seaicemask +#endif implicit none integer, intent(in) :: istep @@ -211,6 +214,13 @@ subroutine update_atm_forcing(istep, ice, tracers, dynamics, partit, mesh) do n=1,myDim_nod2D+eDim_nod2D exchange(n) = UVnode(2,1,n) end do +#if defined (__recom) + elseif (i.eq.8) then + ! GloCO2flux_seaicemask is in [mmol/m2/s], need [kg/m2/s] + ! Conversion: 1.0e-3_WP -> mol/s -> kg/s + ! 1 mol CO2 = 44.0095 g/mol = 0.0440095 kg/mol (NIST 2018) + exchange(:) = GloCO2flux_seaicemask(:) * 1.0e-3_WP * 0.0440095_WP ! [kg m⁻² s⁻¹] +#endif else print *, 'not installed yet or error in cpl_oasis3mct_send', mype #else @@ -390,6 +400,15 @@ subroutine update_atm_forcing(istep, ice, tracers, dynamics, partit, mesh) if (action) then v_wind(:) = exchange(:) ! meridional wind end if +#if defined (__recom) + elseif (i.eq.16) then + if (action) then + ! Convert mass mixing ratio (kg/kg) to mole fraction (dimensionless) + ! MW_CO2 = 44.0095 g/mol (NIST 2018) + ! MW_dry_air = 28.9647 g/mol (standard atmosphere composition) + x_co2atm(:) = exchange(:) * ((28.9647_WP/44.0095_WP)*1e6_WP) ! [mole fraction] + end if +#endif #else elseif (i.eq.13) then if (action) then diff --git a/src/gen_ic3d.F90 b/src/gen_ic3d.F90 index 4af214cd6..732777d0d 100644 --- a/src/gen_ic3d.F90 +++ b/src/gen_ic3d.F90 @@ -412,7 +412,9 @@ SUBROUTINE getcoeffld(tracers, partit, mesh) if (x<0.) x=x+360. if (x>360.) x=x-360. if ( min(i,j)>0 ) then - if (any(ncdata(i:ip1,j:jp1,1) > dummy*0.99_WP)) cycle + ! CAVITY FIX: Check for NaN in climatology data which can occur near cavity regions + if (any(ncdata(i:ip1,j:jp1,1) > dummy*0.99_WP) .or. & + any(.not. ieee_is_finite(ncdata(i:ip1,j:jp1,1)))) cycle x1 = nc_lon(i) x2 = nc_lon(ip1) y1 = nc_lat(j) @@ -423,7 +425,9 @@ SUBROUTINE getcoeffld(tracers, partit, mesh) data1d(:) = ( ncdata(i,j,:) * (x2-x)*(y2-y) + ncdata(ip1,j,:) * (x-x1)*(y2-y) + & ncdata(i,jp1,:) * (x2-x)*(y-y1) + ncdata(ip1, jp1, :) * (x-x1)*(y-y1) ) / denom where (ncdata(i,j,:) > 0.99_WP*dummy .OR. ncdata(ip1,j,:) > 0.99_WP*dummy .OR. & - ncdata(i,jp1,:) > 0.99_WP*dummy .OR. ncdata(ip1,jp1,:) > 0.99_WP*dummy) + ncdata(i,jp1,:) > 0.99_WP*dummy .OR. ncdata(ip1,jp1,:) > 0.99_WP*dummy .OR. & + .not. ieee_is_finite(ncdata(i,j,:)) .OR. .not. ieee_is_finite(ncdata(ip1,j,:)) .OR. & + .not. ieee_is_finite(ncdata(i,jp1,:)) .OR. .not. ieee_is_finite(ncdata(ip1,jp1,:))) data1d(:)=dummy end where @@ -481,6 +485,14 @@ SUBROUTINE getcoeffld(tracers, partit, mesh) end if enddo end if ! --> if (use_cavity) then + else + ! CAVITY FIX: If bilinear interpolation fails (missing data), set fallback values + ! This prevents NaN tracers when climatology has dummy values near cavity regions + do k= ul1, nl1 + if (.not. ieee_is_finite(tracers%data(current_tracer)%values(k,ii))) then + tracers%data(current_tracer)%values(k,ii) = 0.0_WP + endif + enddo end if ! --> if ( min(i,j)>0 ) then end do !ii if (mype==0) then @@ -497,6 +509,7 @@ SUBROUTINE do_ic3d(tracers, partit, mesh) !! ** Purpose : read 3D initial conditions for tracers from netcdf and interpolate on model grid !!---------------------------------------------------------------------- USE insitu2pot_interface + USE ieee_arithmetic IMPLICIT NONE type(t_mesh), intent(in), target :: mesh type(t_partit), intent(inout), target :: partit @@ -521,7 +534,11 @@ SUBROUTINE do_ic3d(tracers, partit, mesh) ! get first coeficients for time inerpolation on model grid for all datas call getcoeffld(tracers, partit, mesh) call nc_end ! deallocate arrqays associated with netcdf file - call extrap_nod(tracers%data(current_tracer)%values(:,:), partit, mesh) + ! CAVITY FIX: Initialize to 0.0 before extrapolation to prevent NaN + where (.not. ieee_is_finite(tracers%data(current_tracer)%values(:,:))) + tracers%data(current_tracer)%values(:,:) = 0.0_WP + end where + call extrap_nod(tracers%data(current_tracer)%values(:,:), partit, mesh) exit elseif (current_tracer==tracers%num_tracers) then if (partit%mype==0) write(*,*) "idlist contains tracer which is not listed in tracer_id!" @@ -534,6 +551,11 @@ SUBROUTINE do_ic3d(tracers, partit, mesh) DEALLOCATE(bilin_indx_i, bilin_indx_j) do current_tracer=1, tracers%num_tracers + !_________________________________________________________________________ + ! CAVITY FIX: Clean up any remaining NaN values before dummy check + where (.not. ieee_is_finite(tracers%data(current_tracer)%values(:,:))) + tracers%data(current_tracer)%values(:,:) = 0.0_WP + end where !_________________________________________________________________________ ! set remaining dummy values from bottom topography to 0.0_WP where (tracers%data(current_tracer)%values > 0.9_WP*dummy) diff --git a/src/gen_modules_clock.F90 b/src/gen_modules_clock.F90 index 3156a4a41..94b270434 100755 --- a/src/gen_modules_clock.F90 +++ b/src/gen_modules_clock.F90 @@ -9,6 +9,7 @@ module g_clock real(kind=WP) :: timeold, timenew !time in a day, unit: sec integer :: dayold, daynew !day in a year integer :: yearold, yearnew !year before and after time step + integer :: yearstart !year when simulation started integer :: month, day_in_month !month and day in a month integer :: fleapyear !1 fleapyear, 0 not integer :: ndpyr !number of days in yearnew @@ -75,7 +76,7 @@ subroutine clock_init(partit) use mod_transit, only: ti_transit, ti_start_transit implicit none type(t_partit), intent(in), target :: partit - integer :: i, daystart, yearstart + integer :: i, daystart real(kind=WP) :: aux1, aux2, timestart integer :: ierr integer :: file_unit diff --git a/src/gen_surface_forcing.F90 b/src/gen_surface_forcing.F90 index b95a99af7..c0d7e65e3 100644 --- a/src/gen_surface_forcing.F90 +++ b/src/gen_surface_forcing.F90 @@ -1457,6 +1457,7 @@ SUBROUTINE sbc_do(partit, mesh) #if defined (__recom) use recom_config use recom_glovar + use REcoM_ciso #endif IMPLICIT NONE @@ -1475,6 +1476,11 @@ SUBROUTINE sbc_do(partit, mesh) real(kind=8), allocatable :: ncdata(:) integer :: CO2start, CO2count integer :: status, ncid, varid + character(300) :: sedfilename + logical :: do_read=.false. + integer :: n_lb + integer, dimension(2) :: istart, icount + real(kind=8) :: total_runoff #endif type(t_partit), intent(inout), target :: partit type(t_mesh), intent(in), target :: mesh @@ -1659,10 +1665,40 @@ SUBROUTINE sbc_do(partit, mesh) ! ******** Atmospheric CO2 ********* if (mstep == 1) then ! The year has changed + if (use_atbox) then +! Atmospheric box model CO2 values + AtmCO2(:) = x_co2atm(1) + if (ciso) then + AtmCO2_13(:) = x_co2atm_13(1) + if (ciso_14) AtmCO2_14(:,1) = x_co2atm_14(1) + end if + else +! Prescribed atmospheric CO2 values + if (constant_CO2) then AtmCO2(:) = CO2_for_spinup if (mype==0) write(*,*) 'Constant_CO2 = ', CO2_for_spinup - if (mype==0) write(*,*),'Atm CO2=', AtmCO2 + if (mype==0) write(*,*),'Atm CO2=', AtmCO2 + if (ciso) then + AtmCO2_13 = CO2_for_spinup * (1. + 0.001 * delta_co2_13) + if (ciso_14) then +! Atmospheric 14C varies with latitude + do i=1, myDim_nod2D +! Latitude of atmospheric input data + lat_val = geo_coord_nod2D(2,i) / rad +! Binning to latitude zones + if (ciso_organic_14) then +! Convert Delta_14C to delta_14C + delta_co2_14 = (big_delta_co2_14(lat_zone(lat_val)) + 2. * delta_co2_13 + 50.) / & + (0.95 - 0.002 * delta_co2_13) + else +! "Inorganic" 14C approximation: delta_14C := Delta_14C + delta_co2_14 = big_delta_co2_14(lat_zone(lat_val)) + end if + AtmCO2_14(lat_zone(lat_val),:) = CO2_for_spinup * (1. + 0.001 * delta_co2_14) + end do + end if + end if else filename=trim(make_full_path(nm_co2_data_file)) if (mype==0) write(*,*) 'Updating CO2 climatology for month ', i,' from ', trim(filename) @@ -1696,8 +1732,266 @@ SUBROUTINE sbc_do(partit, mesh) if (mype==0) write(*,*),'Atm CO2=', AtmCO2 status=nf90_close(ncid) end if + end if ! atmospheric box model or prescribed CO2 values + +! Control output of atmospheric CO2 values + if (mype==0) then !OG + print *, "In atm_input: AtmCO2 = ", AtmCO2(1) + if (ciso) then + print *, " AtmCO2_13 = ", AtmCO2_13(1) + if (ciso_14) print *, " AtmCO2_14 = ", AtmCO2_14(:,1) + end if + if (use_atbox) print *, " use_atbox = .true." + end if + + + +! ******** Sediment input ********* +!-Checking if files need to be opened--------------------------------------------- + if(use_MEDUSA .and. (sedflx_num .ne. 0)) then + allocate(ncdata(9)) + if (recom_debug .and. mype==0) print *, achar(27)//'[36m'//' --> Sed_input'//achar(27)//'[0m' + ! MEDUSA input needs to be renamed via jobscript + sedfilename = trim(ResultPath)//'medusa_flux2fesom.nc' + if (mype==0) write(*,*) 'Updating sedimentary input first time from', sedfilename + +!-Opening files-------------------------------------------------------------------- + + call read_2ddata_on_grid_NetCDF(sedfilename, 'df_din', 1, GloSed(:,1), partit,mesh) +! if (mype==0) write(*,*) mype, 'sediment DIN flux:', maxval(GloSed(:,1)), minval(GloSed(:,1)) + + call read_2ddata_on_grid_NetCDF(sedfilename, 'df_dic', 1, GloSed(:,2), partit, mesh) +! if (mype==0) write(*,*) mype, 'sediment DIC flux:', maxval(GloSed(:,2)), minval(GloSed(:,2)) + + call read_2ddata_on_grid_NetCDF(sedfilename, 'df_alk', 1, GloSed(:,3), partit, mesh) +! if (mype==0) write(*,*) mype, 'sediment Alk flux:', maxval(GloSed(:,3)), minval(GloSed(:,3)) + + call read_2ddata_on_grid_NetCDF(sedfilename, 'df_dsi', 1, GloSed(:,4), partit, mesh) +! if (mype==0) write(*,*) mype, 'sediment DSi flux:', maxval(GloSed(:,4)), minval(GloSed(:,4)) + + call read_2ddata_on_grid_NetCDF(sedfilename, 'df_o2', 1, GloSed(:,5), partit, mesh) +! if (mype==0) write(*,*) mype, 'sediment O2 flux:', maxval(GloSed(:,5)), minval(GloSed(:,5)) + + if(ciso) then + call read_2ddata_on_grid_NetCDF(sedfilename, 'df_dic13', 1, GloSed(:,6), partit, mesh) +! if (mype==0) write(*,*) mype, 'sediment DIC13 flux:', maxval(GloSed(:,6)), minval(GloSed(:,6)) + if(ciso_14) then + call read_2ddata_on_grid_NetCDF(sedfilename, 'df_dic14', 1, GloSed(:,7), partit, mesh) +! if (mype==0) write(*,*) mype, 'sediment DIC14 flux:', maxval(GloSed(:,7)), minval(GloSed(:,7)) + end if ! ciso_14 + end if ! ciso + +! unit conversion + GloSed(:,:)=GloSed(:,:)/86400 + +! read loopback fluxes from the same file + if(add_loopback) then + if (mype==0) write(*,*) 'adding loopback fluxes through runoff for the first time' !OG + + istart = (/1,1/) + icount = (/1,1/) + ncdata = 0.d0 + + total_runoff = 8.76d5*86400 + + status=nf_open(sedfilename, nf_nowrite, ncid) + if(status.ne.nf_noerr) call handle_err(status) + + status=nf_inq_varid(ncid, 'loopback_orgm_din', varid) + if(status.ne.nf_noerr) call handle_err(status) + status=nf_get_vara_double(ncid,varid,istart,icount,ncdata(1)) + if(status.ne.nf_noerr) call handle_err(status) + if (mype==0) write(*,*) mype, 'loopback_orgm_din (mmolN/day):', ncdata(1) !OG + + status=nf_inq_varid(ncid, 'loopback_orgm_dic', varid) + if(status.ne.nf_noerr) call handle_err(status) + status=nf_get_vara_double(ncid,varid,istart,icount,ncdata(2)) + if(status.ne.nf_noerr) call handle_err(status) + if (mype==0) write(*,*) mype, 'loopback_orgm_dic (mmolC/day):', ncdata(2) !OG + + status=nf_inq_varid(ncid, 'loopback_orgm_alk', varid) + if(status.ne.nf_noerr) call handle_err(status) + status=nf_get_vara_double(ncid,varid,istart,icount,ncdata(3)) + if(status.ne.nf_noerr) call handle_err(status) + if (mype==0) write(*,*) mype, 'loopback_orgm_alk (mmolAlk/day):', ncdata(3) !OG + + status=nf_inq_varid(ncid, 'loopback_opal', varid) + if(status.ne.nf_noerr) call handle_err(status) + status=nf_get_vara_double(ncid,varid,istart,icount,ncdata(4)) + if(status.ne.nf_noerr) call handle_err(status) + if (mype==0) write(*,*) mype, 'loopback_opal (mmolSi/day):', ncdata(4) !OG + + status=nf_inq_varid(ncid, 'loopback_caco3', varid) + if(status.ne.nf_noerr) call handle_err(status) + status=nf_get_vara_double(ncid,varid,istart,icount,ncdata(5)) + if(status.ne.nf_noerr) call handle_err(status) + if (mype==0) write(*,*) mype, 'loopback_caco3 (mmolC/day):', ncdata(5) !OG + + if(ciso) then + status=nf_inq_varid(ncid, 'loopback_orgm_dic13', varid) + if(status.ne.nf_noerr) call handle_err(status) + status=nf_get_vara_double(ncid,varid,istart,icount,ncdata(6)) + if(status.ne.nf_noerr) call handle_err(status) + if (mype==0) write(*,*) mype, 'loopback_dic13:', ncdata(6) !OG + + status=nf_inq_varid(ncid, 'loopback_caco313', varid) + if(status.ne.nf_noerr) call handle_err(status) + status=nf_get_vara_double(ncid,varid,istart,icount,ncdata(7)) + if(status.ne.nf_noerr) call handle_err(status) + if (mype==0) write(*,*) mype, 'loopback_caco313:', ncdata(7)!OG + + if(ciso_14 .and. ciso_organic_14) then + status=nf_inq_varid(ncid, 'loopback_orgm_dic14', varid) + if(status.ne.nf_noerr) call handle_err(status) + status=nf_get_vara_double(ncid,varid,istart,icount,ncdata(8)) + if(status.ne.nf_noerr) call handle_err(status) + if (mype==0) write(*,*) mype, 'loopback_dic14:', ncdata(8) !OG + + status=nf_inq_varid(ncid, 'loopback_caco314', varid) + if(status.ne.nf_noerr) call handle_err(status) + status=nf_get_vara_double(ncid,varid,istart,icount,ncdata(9)) + if(status.ne.nf_noerr) call handle_err(status) + if (mype==0) write(*,*) mype, 'loopback_caco314:', ncdata(9) !OG + + end if ! ciso_14 .and. ciso_organic_14 + end if ! ciso + deallocate(ncdata) + status=nf_close(ncid) + +! calculating fluxes back to ocean surface through rivers (mmol/m2/s) +! converting from fluxes out of sediment to fluxes into the ocean + do n_lb = 1,9 + lb_flux(:,n_lb) = -runoff*ncdata(n_lb)/total_runoff*lb_tscale + end do + + end if ! add_loopback + + else + +!-Checking if files need to be opened--------------------------------------------- + call monthly_event(do_read) + if(do_read) then ! file is opened and read every year + i=month + if (i > 12) i=1 + if (mype==0) write(*,*) 'Updating sedimentary input for month', i, 'from', sedfilename !OG + + call read_2ddata_on_grid_NetCDF(sedfilename, 'df_din', 1, GloSed(:,1), partit, mesh) +! if (mype==0) write(*,*) mype, 'sediment DIN flux:', maxval(GloSed(:,1)), minval(GloSed(:,1)) + + call read_2ddata_on_grid_NetCDF(sedfilename, 'df_dic', 1, GloSed(:,2), partit, mesh) +! if (mype==0) write(*,*) mype, 'sediment DIC flux:', maxval(GloSed(:,2)), minval(GloSed(:,2)) + + call read_2ddata_on_grid_NetCDF(sedfilename, 'df_alk', 1, GloSed(:,3), partit, mesh) +! if (mype==0) write(*,*) mype, 'sediment Alk flux:', maxval(GloSed(:,3)), minval(GloSed(:,3)) + + call read_2ddata_on_grid_NetCDF(sedfilename, 'df_dsi', 1, GloSed(:,4), partit, mesh) +! if (mype==0) write(*,*) mype, 'sediment DSi flux:', maxval(GloSed(:,4)), minval(GloSed(:,4)) + + call read_2ddata_on_grid_NetCDF(sedfilename, 'df_o2', 1, GloSed(:,5), partit, mesh) +! if (mype==0) write(*,*) mype, 'sediment O2 flux:', maxval(GloSed(:,5)), minval(GloSed(:,5)) + + if(ciso) then + call read_2ddata_on_grid_NetCDF(sedfilename, 'df_dic13', 1, GloSed(:,6), partit, mesh) +! if (mype==0) write(*,*) mype, 'sediment DIC13 flux:', maxval(GloSed(:,6)), minval(GloSed(:,6)) + if(ciso_14) then + call read_2ddata_on_grid_NetCDF(sedfilename, 'df_dic14', 1, GloSed(:,7), partit, mesh) +! if (mype==0) write(*,*) mype, 'sediment DIC14 flux:', maxval(GloSed(:,7)), minval(GloSed(:,7)) + end if ! ciso_14 + end if ! ciso + +!to mmol/m2/s + GloSed(:,:)=GloSed(:,:)/86400 + +! read loopback fluxes from the same file + if(add_loopback) then + if (mype==0) write(*,*) 'adding loopback fluxes into the ocean monthly' !OG + + istart = (/1,1/) + icount = (/1,1/) + ncdata = 0.d0 + + total_runoff = 8.76d5*86400 + + status=nf_open(sedfilename, nf_nowrite, ncid) + if(status.ne.nf_noerr) call handle_err(status) + + status=nf_inq_varid(ncid, 'loopback_orgm_din', varid) + if(status.ne.nf_noerr) call handle_err(status) + status=nf_get_vara_double(ncid,varid,istart,icount,ncdata(1)) + if(status.ne.nf_noerr) call handle_err(status) + if (mype==0) write(*,*) mype, 'loopback_orgm_din (mmolN/day):', ncdata(1) !OG + + status=nf_inq_varid(ncid, 'loopback_orgm_dic', varid) + if(status.ne.nf_noerr) call handle_err(status) + status=nf_get_vara_double(ncid,varid,istart,icount,ncdata(2)) + if(status.ne.nf_noerr) call handle_err(status) + if (mype==0) write(*,*) mype, 'loopback_orgm_dic (mmolC/day):', ncdata(2) !OG + + status=nf_inq_varid(ncid, 'loopback_orgm_alk', varid) + if(status.ne.nf_noerr) call handle_err(status) + status=nf_get_vara_double(ncid,varid,istart,icount,ncdata(3)) + if(status.ne.nf_noerr) call handle_err(status) + if (mype==0) write(*,*) mype, 'loopback_orgm_alk (mmolAlk/day):', ncdata(3) !OG + + status=nf_inq_varid(ncid, 'loopback_opal', varid) + if(status.ne.nf_noerr) call handle_err(status) + status=nf_get_vara_double(ncid,varid,istart,icount,ncdata(4)) + if(status.ne.nf_noerr) call handle_err(status) + if (mype==0) write(*,*) mype, 'loopback_opal (mmolSi/day):', ncdata(4) !OG + + status=nf_inq_varid(ncid, 'loopback_caco3', varid) + if(status.ne.nf_noerr) call handle_err(status) + status=nf_get_vara_double(ncid,varid,istart,icount,ncdata(5)) + if(status.ne.nf_noerr) call handle_err(status) + if (mype==0) write(*,*) mype, 'loopback_caco3 (mmolC/day):', ncdata(5) !OG + + if(ciso) then + status=nf_inq_varid(ncid, 'loopback_orgm_dic13', varid) + if(status.ne.nf_noerr) call handle_err(status) + status=nf_get_vara_double(ncid,varid,istart,icount,ncdata(6)) + if(status.ne.nf_noerr) call handle_err(status) + if (mype==0) write(*,*) mype, 'loopback_dic13:', ncdata(6) !OG + + status=nf_inq_varid(ncid, 'loopback_caco313', varid) + if(status.ne.nf_noerr) call handle_err(status) + status=nf_get_vara_double(ncid,varid,istart,icount,ncdata(7)) + if(status.ne.nf_noerr) call handle_err(status) + if (mype==0) write(*,*) mype, 'loopback_caco313:', ncdata(7) !OG + + if(ciso_14 .and. ciso_organic_14) then + status=nf_inq_varid(ncid, 'loopback_orgm_dic14', varid) + if(status.ne.nf_noerr) call handle_err(status) + status=nf_get_vara_double(ncid,varid,istart,icount,ncdata(8)) + if(status.ne.nf_noerr) call handle_err(status) + if (mype==0) write(*,*) mype, 'loopback_dic14:', ncdata(8) !OG + + status=nf_inq_varid(ncid, 'loopback_caco314', varid) + if(status.ne.nf_noerr) call handle_err(status) + status=nf_get_vara_double(ncid,varid,istart,icount,ncdata(9)) + if(status.ne.nf_noerr) call handle_err(status) + if (mype==0) write(*,*) mype, 'loopback_caco314:', ncdata(9) !OG + + end if ! ciso_14 .and. ciso_organic_14 + end if ! ciso + status=nf_close(ncid) + +! calculating fluxes back to ocean surface through rivers (mmol/m2/s) +! converting from fluxes out of sediment to fluxes into the ocean + do n_lb = 1,9 + lb_flux(:,n_lb) = -runoff*ncdata(n_lb)/total_runoff*lb_tscale + end do + + end if ! add_loopback + + end if ! do_read + + if (mype==0) write(*,*) 'sedimentary input from MEDUSA not used!' !OG + + end if ! use_MEDUSA and sedflx_num not 0 + end if + ! ******** Fe deposition ********* if (fe_data_source=='Albani') then if (update_monthly_flag) then diff --git a/src/int_recom/recom/gasx.F90 b/src/int_recom/recom/gasx.F90 index bd5473527..c4d2d8b01 100755 --- a/src/int_recom/recom/gasx.F90 +++ b/src/int_recom/recom/gasx.F90 @@ -6,7 +6,7 @@ MODULE gasx !> Computes air-sea CO2 flux & surface-ocean carbonate system vars (pH, CO2*, HCO3- and CO32-, OmegaA, OmegaC, R) !! from T, S, P, ALK, DIC, total inorganic silicon, total inorganic phosphorus, all as 1-D arrays SUBROUTINE flxco2(co2flux, co2ex, dpco2, & - ph, pco2, fco2, co2, hco3, co3, OmegaA, OmegaC, BetaD, rhoSW, p, tempis, & + ph, pco2, fco2, co2, hco3, co3, OmegaA, OmegaC, BetaD, rhoSW, p, tempis, K0, & temp, sal, alk, dic, sil, phos, kw660, xco2, Patm, dz1, N, lon, lat, & optCON, optT, optP, optB, optK1K2, optKf, optGAS, optS ) ! Purpose: @@ -127,6 +127,8 @@ SUBROUTINE flxco2(co2flux, co2ex, dpco2, ! rhoSW = in-situ density of seawater; rhoSW = f(s, t, p) ! p = pressure [decibars]; p = f(depth, latitude) if computed from depth [m] OR p = depth if [db] ! tempis = in-situ temperature [degrees C] + ! K0 = CO2 solubility [(mol/kg) / atm] + #if USE_PRECISION == 2 # define SGLE(x) (x) @@ -237,10 +239,12 @@ SUBROUTINE flxco2(co2flux, co2ex, dpco2, REAL(kind=rx), INTENT(out), DIMENSION(N) :: p !> in-situ temperature \b [degrees C] REAL(kind=rx), INTENT(out), DIMENSION(N) :: tempis + !> K0, solubility of CO2 \b [(mol/kg) / atm] + REAL(kind=rx), INTENT(out), DIMENSION(N) :: K0 ! Local variables REAL(kind=r8) :: tk, invtk, dtemp - REAL(kind=r8) :: tmp, K0, co2star, co2starair, kwco2 + REAL(kind=r8) :: tmp, co2star, co2starair, kwco2 ! K0 REAL(kind=rx), DIMENSION(N) :: pCO2atm, fCO2atm REAL(kind=rx), DIMENSION(N) :: depth0, lat0 @@ -361,7 +365,7 @@ SUBROUTINE flxco2(co2flux, co2ex, dpco2, K0 = EXP( tmp + DBLE(salprac(i))*(0.023517d0 - 0.00023656d0*tk + 0.0047036e-4_r8*tk*tk) ) ! "Atmospheric" [CO2*], air-sea CO2 flux, sfc DIC rate of change, & Delta pCO2 - co2starair = K0 * DBLE(fco2atm(i)) * 1.0e-6_r8 * DBLE(rhoSW(i)) !Equil. [CO2*] for atm CO2 at Patm & sfc-water T,S [mol/m3] + co2starair = K0(i) * DBLE(fco2atm(i)) * 1.0e-6_r8 * DBLE(rhoSW(i)) !Equil. [CO2*] for atm CO2 at Patm & sfc-water T,S [mol/m3] co2star = DBLE(co2(i)) !Oceanic [CO2*] in [mol/m3] from vars.f90 co2flux(i) = SGLE(kwco2 * (co2starair - co2star)) !Air-sea CO2 flux [mol/(m2 * s)] ! the conversion from co2flux to impact on dic is done in recom_forcing/recom_sms diff --git a/src/int_recom/recom/vars.F90 b/src/int_recom/recom/vars.F90 index 2ef70defa..d20069a10 100755 --- a/src/int_recom/recom/vars.F90 +++ b/src/int_recom/recom/vars.F90 @@ -570,7 +570,7 @@ SUBROUTINE vars_sprac (ph, pco2, fco2, co2, hco3, co3, OmegaA, OmegaC, kspc_out, ! If Absolute salinity is given IF (trim(opS) == 'Sabs') THEN ! If in-situ or potential temperature is given - IF (trim(optT) /= 'Scsv') THEN + IF (trim(optT) /= 'Scsv') THEN !!!!!!!!! Is it a bug? OG 20.03.2025 Scsv -> Tcsv .OR. tcsv ! First compute conservative temperature tempcsv = gsw_ct_from_t (DBLE(ssal), tempis90, DBLE(p(i))) ELSE diff --git a/src/int_recom/recom_atbox.F90 b/src/int_recom/recom_atbox.F90 new file mode 100644 index 000000000..4e579c51e --- /dev/null +++ b/src/int_recom/recom_atbox.F90 @@ -0,0 +1,92 @@ + subroutine recom_atbox(partit, mesh) +! Simple 0-d box model to calculate the temporal evolution of atmospheric CO2. +! Initially the box model was part of module recom_ciso. Now it can be run also +! without carbon isotopes (ciso==.false.) +! mbutzin, 2021-07-08 + +! Settings are copied from subroutine bio_fluxes, +! some of the following modules may be unnecessary here +! use REcoM_declarations +! use REcoM_LocVar + use REcoM_GloVar + use recom_config + use recom_ciso + + use mod_mesh + USE MOD_PARTIT + USE MOD_PARSUP + + use g_config + use o_arrays + use g_comm_auto + use g_forcing_arrays + use g_support + + + implicit none + integer :: n, elem, elnodes(3),n1 + real(kind=WP) :: total_co2flux, & ! (mol / s) + total_co2flux_13, & ! (mol / s) carbon-13 + total_co2flux_14 ! (mol / s) radiocarbon + real(kind=WP), parameter :: mol_allatm = 1.7726e20 ! atmospheric inventory of all compounds (mol) + type(t_partit), intent(inout), target :: partit + type(t_mesh) , intent(inout), target :: mesh + +#include "../associate_part_def.h" +#include "../associate_mesh_def.h" +#include "../associate_part_ass.h" +#include "../associate_mesh_ass.h" + +! Globally integrated air-sea CO2 flux (mol / s) + total_co2flux = 0. + call integrate_nod(0.001 * GloCO2flux_seaicemask , total_CO2flux, partit, mesh) + +! Atmospheric carbon budget (mol) +! mass of the dry atmosphere = 5.1352e18 kg (Trenberth & Smith 2005, doi:10.1175/JCLI-3299.1) +! mean density of air = 0.02897 kg / mol (https://nssdc.gsfc.nasa.gov/planetary/factsheet/earthfact.html) +! => total molecular inventory of the dry atmosphere: moles_atm = 1.7726e20 mol == constant. +! mol_co2atm = mol_co2atm - total_co2flux * dt +! Atmospheric mixing ratios in ppm +! x_co2atm(1) = mol_co2atm / mol_allatm * 1.e6 ! ppm + x_co2atm(1) = x_co2atm(1) - total_co2flux / mol_allatm * dt * 1.e6 + x_co2atm = x_co2atm(1) + + if (ciso) then +! Consider 13CO2 (and maybe also 14CO2) + +! Globally integrated air-sea 13CO2 flux (mol / s) + total_co2flux_13 = 0. + call integrate_nod(0.001 * GloCO2flux_seaicemask_13, total_co2flux_13, partit, mesh) + +! Atmospheric carbon-13 budget (mol) +! mol_co2atm_13 = mol_co2atm_13 - total_co2flux_13 * dt +! Budget in terms of the 13C / 12C volume mixing ratio +! x_co2atm_13(1) = mol_co2atm_13 / mol_allatm * 1.e6 + x_co2atm_13(1) = x_co2atm_13(1) - total_co2flux_13 / mol_allatm * dt * 1.e6 + x_co2atm_13 = x_co2atm_13(1) + + if (ciso_14) then + total_co2flux_14 = 0. ! globally integrated air-sea 14CO2 flux (mol / s) + call integrate_nod(0.001 * GloCO2flux_seaicemask_14, total_co2flux_14, partit, mesh) +! Atmospheric radiocarbon budget in mol: +! mol_co2atm_14 = mol_co2atm_14 + dt * (cosmic_14(1) - mol_co2atm_14 * lambda_14 - total_co2flux_14) +! = (mol_co2atm_14 + dt * (cosmic_14(1) - total_co2flux_14)) / (1 + lambda_14 * dt) +! Budget in terms of the 14C / 12C volume mixing ratio + x_co2atm_14(1) = (x_co2atm_14(1) + dt * (cosmic_14(1) - total_co2flux_14) / mol_allatm * 1.e6) / & + (1 + lambda_14 * dt) + x_co2atm_14 = x_co2atm_14(1) + +! Adjust cosmogenic 14C production (mol / s) in spinup runs, + r_atm_14 = x_co2atm_14(1) / x_co2atm(1) +! r_atm_spinup_14 is calculated once-only in subroutine recom_init + if (atbox_spinup .and. abs(r_atm_14 - r_atm_spinup_14) > 0.001) then + cosmic_14(1) = cosmic_14(1) * (r_atm_spinup_14 / r_atm_14) +! cosmic_14(1) = cosmic_14(1) * (1 + 0.01 * (r_atm_14_spinup / r_atm_14)) + end if + cosmic_14 = cosmic_14(1) + endif + end if + + return + end subroutine recom_atbox + diff --git a/src/int_recom/recom_extra.F90 b/src/int_recom/recom_extra.F90 index 5495e0c8f..363438443 100644 --- a/src/int_recom/recom_extra.F90 +++ b/src/int_recom/recom_extra.F90 @@ -1,34 +1,35 @@ !=============================================================================== ! Subroutine for calculating flux-depth and thickness of control volumes !=============================================================================== -subroutine Depth_calculations(n,Nn,wF,zF,thick,recipthick, partit, mesh) - use recom_config +subroutine Depth_calculations(n, nn, wf, zf, thick, recipthick, partit, mesh) + use recom_config use mod_mesh - USE MOD_PARTIT - USE MOD_PARSUP - USE o_PARAM - USE o_ARRAYS - USE g_CONFIG - use g_forcing_arrays - use g_comm_auto - - use g_clock - use g_rotate_grid - - implicit none -! Input - type(t_partit), intent(inout), target :: partit - type(t_mesh) , intent(inout), target :: mesh - - Integer, intent(in) :: Nn ! Total number of nodes -! Output - real(kind=8),dimension(mesh%nl), intent(out) :: zF ! [m] Depth of vertical fluxes + use MOD_PARTIT + use MOD_PARSUP + use o_PARAM + use o_ARRAYS + use g_CONFIG + use g_forcing_arrays + use g_comm_auto + use g_clock + use g_rotate_grid + + implicit none + + ! Input parameters + type(t_partit), intent(inout), target :: partit + type(t_mesh) , intent(inout), target :: mesh + integer , intent(in) :: nn ! Total number of vertical nodes + integer , intent(in) :: n ! Current node - real(kind=8),dimension(mesh%nl-1), intent(out) :: thick ! [m] Distance between two nodes = thickness - real(kind=8),dimension(mesh%nl-1), intent(out) :: recipthick ! [1/m] reciprocal of thickness + ! Output arrays + real(kind=8), dimension(mesh%nl,6), intent(out) :: wf ! [m/day] Flux velocities at the border of the control volumes + real(kind=8), dimension(mesh%nl), intent(out) :: zf ! [m] Depth of vertical fluxes + real(kind=8), dimension(mesh%nl-1), intent(out) :: thick ! [m] Distance between two nodes = layer thickness + real(kind=8), dimension(mesh%nl-1), intent(out) :: recipthick ! [1/m] Reciprocal thickness - real(kind=8),dimension(mesh%nl,5), intent(out) :: wF ! [m/day] Velocities of fluxes at the border of the control volumes - Integer :: k, n ! Index for depth + ! Local variables + integer :: k ! Layer index #include "../associate_part_def.h" #include "../associate_mesh_def.h" @@ -48,16 +49,17 @@ subroutine Depth_calculations(n,Nn,wF,zF,thick,recipthick, partit, mesh) ! allocate(Z_3d_n(nl-1,myDim_nod2D+eDim_nod2D)) ! ============================================================================== modular -!! Background sinking speed + !! Background sinking speed + wF(2:Nn, ivphy) = VPhy ! Phytoplankton sinking velocity + wF(2:Nn, ivdia) = VDia ! Diatoms sinking velocity + wF(2:Nn, ivdet) = VDet ! Detritus sinking velocity + wF(2:Nn, ivdetsc) = VDet_zoo2 ! Second detritus sinking velocity + wF(2:Nn, ivcoc) = VCocco ! Coccolithophores sinking velocity + wF(2:Nn, ivpha) = VPhaeo - wF(2:Nn,ivphy) = VPhy - wF(2:Nn,ivdia) = VDia - wF(2:Nn,ivdet) = VDet - wF(2:Nn,ivdetsc) = VDet_zoo2 - wF(2:Nn,ivcoc) = VCocco - - wF(1,:) = 0.d0 - wF(Nn+1,:) = 0.d0 + !! Boundary conditions (surface and bottom) + wF(1,:) = 0.d0 + wF(Nn+1,:) = 0.d0 !if (allow_var_sinking) then !! wF(2:Nn+1,ivdet) = Vdet_a * abs(zbar_n(2:Nn+1)) + VDet @@ -65,31 +67,25 @@ subroutine Depth_calculations(n,Nn,wF,zF,thick,recipthick, partit, mesh) ! wF(2:Nn+1,ivdet) = Vcalc * abs(zbar_3d_n(2:Nn+1, n)) + VDet !end if -!---------------------------------------------------- -! Vertical layers thickness - - thick =0.0_WP - recipthick=0.0_WP - zF=0.0_WP - -!do n=1,myDim_nod2D+eDim_nod2D - do k=1, Nn !nlevels_nod2D(n)-1 - thick(k)=hnode(k,n) - if (hnode(k,n) > 0._WP) then - recipthick(k)=1./hnode(k,n) - else - recipthick(k)=0._WP - end if - end do -!end do - -! layer depth (negative) - -!do n=1,myDim_nod2D+eDim_nod2D - do k=1, Nn+1 !nlevels_nod2D(n) - zF(k)=zbar_3d_n(k,n) - end do -!end do + !! Calculate layer thickness and reciprocal of it + thick = 0.0_WP + recipthick = 0.0_WP + zf = 0.0_WP + + do k=1, nn + thick(k) = hnode(k,n) + if (hnode(k,n) > 0.0_WP) then +! if thick(k) > 0.0_WP) then ! alternative + recipthick(k) = 1.0/hnode(k,n) + else + recipthick(k) = 0.0_WP + end if + end do + + !! set layer depth (negative) + do k=1, nn+1 + zf(k)=zbar_3d_n(k,n) + end do end subroutine Depth_calculations @@ -100,24 +96,26 @@ subroutine Cobeta(partit, mesh) use REcoM_GloVar use g_clock use mod_mesh - USE MOD_PARTIT - USE MOD_PARSUP + use MOD_PARTIT + use MOD_PARSUP use o_PARAM use g_comm_auto - Implicit none + + implicit none -! Declarations - real(kind=8) :: yearfrac ! The fraction of the year that has passed [0 1] - real(kind=8) :: yDay ! yearfrac in radians [0 2*pi] - real(kind=8) :: declination = 0.d0 ! Declination of the sun at present lat and time - real(kind=8) :: CosAngleNoon = 0.d0 ! Cos(Angle of Incidence) at Noon ? - integer :: n + ! Input parameters + type(t_partit), intent(inout), target :: partit + type(t_mesh) , intent(inout), target :: mesh -! Constants - real(kind=8) :: nWater = 1.33 + ! Local variables + real(kind=8) :: yearfrac ! Fraction of year [0 1] + real(kind=8) :: yDay ! Year fraction in radians [0 2*pi] + real(kind=8) :: declination = 0.d0 ! Declination of the sun at present lat and time + real(kind=8) :: CosAngleNoon = 0.d0 ! Cosine of Angle of Incidence at noon + integer :: n - type(t_partit), intent(inout), target :: partit - type(t_mesh) , intent(inout), target :: mesh + ! Constants + real(kind=8), parameter :: nWater = 1.33 ! Refractive indices of water #include "../associate_part_def.h" #include "../associate_mesh_def.h" @@ -131,9 +129,11 @@ subroutine Cobeta(partit, mesh) !! Publishing Company, Amsterdam, Oxford, !! New York, 1976, ISBN 0-444-41444-4. - yearfrac = mod(real(daynew),real(ndpyr))/real(ndpyr) - yDay = 2 * pi * yearfrac - declination = 0.006918 & + !! Calculate solar declination using Paltridge & Platt (1976) formula + yearfrac = mod(real(daynew), real(ndpyr)) / real(ndpyr) + yDay = 2.0d0 * pi * yearfrac + + declination = 0.006918 & - 0.399912 * cos( yDay) & + 0.070257 * sin( yDay) & - 0.006758 * cos(2 * yDay) & @@ -141,33 +141,35 @@ subroutine Cobeta(partit, mesh) - 0.002697 * cos(3 * yDay) & + 0.001480 * sin(3 * yDay) - do n=1, myDim_nod2D!+eDim_nod2D - - cosAngleNoon = sin(geo_coord_nod2D(2,n)) * sin(declination) & - + cos(geo_coord_nod2D(2,n)) * cos(declination) - cosAI(n) = sqrt(1-(1-cosAngleNoon**2)/nWater**2) + !! Calculate cosine of angle of incidence for each node + do n = 1, myDim_nod2D + cosAngleNoon = sin(geo_coord_nod2D(2, n)) * sin(declination) & + + cos(geo_coord_nod2D(2, n)) * cos(declination) - end do + cosAI(n) = sqrt(1.0d0 - (1.0d0 - cosAngleNoon**2) / nWater**2) + end do end subroutine Cobeta !================================================================================ ! Calculating second zooplankton respiration rates !================================================================================ subroutine krill_resp(n, partit, mesh) - use REcoM_declarations - use REcoM_LocVar - use REcoM_GloVar - use g_clock - use o_PARAM -! use g_PARSUP + use REcoM_declarations + use REcoM_LocVar + use REcoM_GloVar + use g_clock + use o_PARAM use mod_mesh - USE MOD_PARTIT - USE MOD_PARSUP - use g_comm_auto - implicit none - integer :: n - - type(t_partit), intent(inout), target :: partit - type(t_mesh) , intent(inout), target :: mesh + use MOD_PARTIT + use MOD_PARSUP + use g_comm_auto + + implicit none + + ! Input parameters + integer :: n + type(t_partit), intent(inout), target :: partit + type(t_mesh) , intent(inout), target :: mesh + #include "../associate_part_def.h" #include "../associate_mesh_def.h" #include "../associate_part_ass.h" @@ -201,4 +203,3 @@ subroutine krill_resp(n, partit, mesh) end if endif end subroutine krill_resp - diff --git a/src/int_recom/recom_forcing.F90 b/src/int_recom/recom_forcing.F90 index 81650779d..52d434e01 100644 --- a/src/int_recom/recom_forcing.F90 +++ b/src/int_recom/recom_forcing.F90 @@ -1,7 +1,7 @@ !=============================================================================== ! REcoM_Forcing !=============================================================================== -subroutine REcoM_Forcing(zNodes, n, Nn, state, SurfSW, Loc_slp , Temp, Sali, Sali_depth & +subroutine REcoM_Forcing(zNodes, n, Nn, state, SurfSW, Loc_slp, Temp, Sali, Sali_depth & , CO2_watercolumn & , pH_watercolumn & , pCO2_watercolumn & @@ -66,7 +66,7 @@ subroutine REcoM_Forcing(zNodes, n, Nn, state, SurfSW, Loc_slp , Temp, Sali, Sal !!---- Subroutine Depth real(kind=8),dimension(mesh%nl) :: zF ! [m] Depth of fluxes - real(kind=8),dimension(mesh%nl,5) :: SinkVel ! [m/day] + real(kind=8),dimension(mesh%nl,6) :: SinkVel ! [m/day] real(kind=8),dimension(mesh%nl-1) :: thick ! [m] Vertical distance between two nodes = Thickness real(kind=8),dimension(mesh%nl-1) :: recipthick ! [1/m] reciprocal of thick @@ -111,8 +111,11 @@ subroutine REcoM_Forcing(zNodes, n, Nn, state, SurfSW, Loc_slp , Temp, Sali, Sal tiny_Si = tiny_C_d/SiCmax ! SiCmax = 0.8d0 #if defined (__coccos) - tiny_N_c = tiny_chl/chl2N_max_c ! 0.00001/ 3.5d0 + tiny_N_c = tiny_chl/chl2N_max_c ! 0.00001/ 3.5d0 tiny_C_c = tiny_N_c/NCmax_c ! NCmax_c = 0.15d0 + + tiny_N_p = tiny_chl/chl2N_max_p ! 0.00001/ 3.5d0 + tiny_C_p = tiny_N_p/NCmax_p ! NCmax_c = 0.15d0 #endif call Cobeta(partit, mesh) @@ -182,15 +185,38 @@ subroutine REcoM_Forcing(zNodes, n, Nn, state, SurfSW, Loc_slp , Temp, Sali, Sal stop endif - call flxco2(co2flux, co2ex, dpco2surf, & - ph, pco2surf, fco2, co2, hco3, co3, OmegaA, OmegaC, BetaD, rhoSW, p, tempis, & - REcoM_T, REcoM_S, REcoM_Alk, REcoM_DIC, REcoM_Si, REcoM_Phos, kw660, LocAtmCO2, Patm, thick(One), Nmocsy, Lond,Latd, & - optCON='mol/m3',optT='Tpot ',optP='m ',optB='u74',optK1K2='l ',optKf='dg',optGAS='Pinsitu',optS='Sprc') + !!---- Skip CO2 flux calculation in ice shelf cavities (ulevels_nod2d > 1) + !!---- Cavity nodes have uninitialized biogeochemical tracers + !!---- NOTE: ulevels_nod2d is already indexed by local node numbers + if (mesh%ulevels_nod2d(n) > 1) then + !! Set CO2 flux to zero in cavity regions + co2flux(1) = 0.0d0 + co2ex(1) = 0.0d0 + dpco2surf(1) = 0.0d0 + ph(1) = 8.0d0 + pco2surf(1) = 0.0d0 + fco2(1) = 0.0d0 + co2(1) = 0.0d0 + hco3(1) = 0.0d0 + co3(1) = 0.0d0 + OmegaA(1) = 0.0d0 + OmegaC(1) = 0.0d0 + BetaD(1) = 0.0d0 + rhoSW(1) = 1027.0d0 + else + !! Calculate CO2 flux for non-cavity nodes + call flxco2(co2flux, co2ex, dpco2surf, & + ph, pco2surf, fco2, co2, hco3, co3, OmegaA, OmegaC, BetaD, rhoSW, p, tempis, K0, & + REcoM_T, REcoM_S, REcoM_Alk, REcoM_DIC, REcoM_Si, REcoM_Phos, kw660, LocAtmCO2, Patm, thick(One), Nmocsy, Lond,Latd, & + optCON='mol/m3',optT='Tpot ',optP='m ',optB='u74',optK1K2='l ',optKf='dg',optGAS='Pinsitu',optS='Sprc') + endif ! changed optK1K2='l ' to 'm10' if((co2flux(1)>1.e10) .or. (co2flux(1)<-1.e10)) then ! co2flux(1)=0.0 print*, 'ERROR: co2 flux !' + print*, 'ulevels_nod2d(n): ',mesh%ulevels_nod2d(n) + print*, 'node n (local): ',n print*, 'pco2surf: ',pco2surf print*, 'co2: ',co2 print*, 'rhoSW: ', rhoSW @@ -227,9 +253,16 @@ subroutine REcoM_Forcing(zNodes, n, Nn, state, SurfSW, Loc_slp , Temp, Sali, Sal ppo = Loc_slp/Pa2atm !1 !slp divided by 1 atm REcoM_O2 = max(tiny*1e-3,state(one,ioxy)*1e-3) ! convert from mmol/m3 to mol/m3 for mocsy - call o2flux(REcoM_T, REcoM_S, kw660, ppo, REcoM_O2, Nmocsy, o2ex) - oflux = o2ex * 1.e3 *SecondsPerDay !* (1.d0 - Loc_ice_conc) [mmol/m2/d] - o2flux_seaicemask = o2ex * 1.e3 ! back to mmol here [mmol/m2/s] + !!---- Skip O2 flux calculation in ice shelf cavities + if (mesh%ulevels_nod2d(n) > 1) then + o2ex(1) = 0.0d0 + oflux = 0.0d0 + o2flux_seaicemask = 0.0d0 + else + call o2flux(REcoM_T, REcoM_S, kw660, ppo, REcoM_O2, Nmocsy, o2ex) + oflux = o2ex * 1.e3 *SecondsPerDay !* (1.d0 - Loc_ice_conc) [mmol/m2/d] + o2flux_seaicemask = o2ex * 1.e3 ! back to mmol here [mmol/m2/s] + endif ! Source-Minus-Sinks @@ -263,6 +296,10 @@ subroutine REcoM_Forcing(zNodes, n, Nn, state, SurfSW, Loc_slp , Temp, Sali, Sal state(1:nn,icchl) = max(tiny_chl,state(1:nn,icchl)) state(1:nn,icocn) = max(tiny_N_c,state(1:nn,icocn)) state(1:nn,icocc) = max(tiny_C_c,state(1:nn,icocc)) + + state(1:nn,iphachl) = max(tiny_chl,state(1:nn,iphachl)) + state(1:nn,iphan) = max(tiny_N_p,state(1:nn,iphan)) + state(1:nn,iphac) = max(tiny_C_p,state(1:nn,iphac)) #endif #if defined (__3Zoo2Det) @@ -272,6 +309,54 @@ subroutine REcoM_Forcing(zNodes, n, Nn, state, SurfSW, Loc_slp , Temp, Sali, Sal if (recom_debug .and. mype==0) print *, achar(27)//'[36m'//' --> ciso after REcoM_Forcing'//achar(27)//'[0m' + if (ciso) then +! Calculate carbon-isotopic fractionation, radioactive decay is calculated in oce_ale_tracer.F90 + +! Fractionation due to air-sea exchange and chemical speciation of CO2 + call recom_ciso_airsea(recom_t(1), co3(1), recom_dic(1)) ! -> alpha_aq, alpha_dic. CO3 is taken from mocsy + +! Isotopic ratios of dissolved CO2, also needed to calculate biogenic fractionation + r_dic_13 = max(tiny*1e-3,state(1,idic_13)*1e-3) / recom_dic(1) + r_co2s_13 = alpha_aq_13 / alpha_dic_13 * r_dic_13 +! Calculate air-sea fluxes of 13|14CO2 in mmol / m**2 / s + kwco2 = kw660(1) * (660/scco2(REcoM_T(1)))**0.5 ! Piston velocity (via mocsy) + co2sat = co2flux(1) / (kwco2 + tiny) + co2(1) ! Saturation concentration of CO2 (via mocsy) +! co2flux_13 = kwco2 * alpha_k_13 * (alpha_aq_13 * r_atm_13 * co2sat - r_co2s_13 * co2(1)) +! co2flux_13 = alpha_k_13 * alpha_aq_13 * kwco2 * (r_atm_13 * co2sat - r_dic_13 * co2(1) / alpha_dic_13) +! Fractionation factors were determined for freshwater, include a correction for enhanced fractionation in seawater + co2flux_13 = (alpha_k_13 * alpha_aq_13 - 0.0002) * kwco2 * (r_atm_13 * co2sat - r_dic_13 * co2(1) / alpha_dic_13) + co2flux_seaicemask_13 = co2flux_13 * 1.e3 + +! Biogenic fractionation due to photosynthesis of plankton +! phyc_13|14 and diac_13|14 are only used in REcoM_sms to calculate DIC_13|14, DOC_13|14 and DetC_13|14 + + call recom_ciso_photo(co2(1)) ! -> alpha_p + r_phyc_13 = r_co2s_13 / alpha_p_13 + r_diac_13 = r_co2s_13 / alpha_p_dia_13 + state(1:nn,iphyc_13) = max((tiny_C * r_phyc_13), (state(1:nn,iphyc) * r_phyc_13)) + state(1:nn,idiac_13) = max((tiny_C_d * r_diac_13), (state(1:nn,idiac) * r_diac_13)) + +! The same for radiocarbon, fractionation factors have been already derived above + if (ciso_14) then +! Air-sea exchange + r_dic_14 = max(tiny*1e-3,state(1,idic_14)*1e-3) / recom_dic(1) + r_co2s_14 = alpha_aq_14 / alpha_dic_14 * r_dic_14 +! co2flux_14 = kwco2 * alpha_k_14 * (alpha_aq_14 * r_atm_14 * co2sat - r_co2s_14 * co2(1)) +! Fractionation factors were determined for freshwater, include a correction for enhanced fractionation seawater + co2flux_14 = (alpha_k_14 * alpha_aq_14 - 0.0004) * kwco2 * (r_atm_14 * co2sat - r_dic_14 * co2(1) / alpha_dic_14) + co2flux_seaicemask_14 = co2flux_14 * 1.e3 +! Biogenic fractionation + if (ciso_organic_14) then + r_phyc_14 = r_co2s_14 / alpha_p_14 + r_diac_14 = r_co2s_14 / alpha_p_dia_14 + state(1:nn,iphyc_14) = max((tiny_C * r_phyc_14), (state(1:nn,iphyc) * r_phyc_14)) + state(1:nn,idiac_14) = max((tiny_C_d * r_diac_14), (state(1:nn,idiac) * r_diac_14)) + end if + end if +! Radiocarbon + end if +! ciso + !------------------------------------------------------------------------------- ! Diagnostics if (Diags) then @@ -291,10 +376,17 @@ subroutine REcoM_Forcing(zNodes, n, Nn, state, SurfSW, Loc_slp , Temp, Sali, Sal locNNAd = sum(vertNNAd(1:nn) * thick(1:nn)) locChldegd = sum(vertChldegd(1:nn) * thick(1:nn)) +#if defined (__coccos) locNPPc = sum(vertNPPc(1:nn) * thick(1:nn)) locGPPc = sum(vertGPPc(1:nn) * thick(1:nn)) locNNAc = sum(vertNNAc(1:nn) * thick(1:nn)) locChldegc = sum(vertChldegc(1:nn) * thick(1:nn)) + locNPPp = sum(vertNPPp(1:nn) * thick(1:nn)) + locGPPp = sum(vertGPPp(1:nn) * thick(1:nn)) + locNNAp = sum(vertNNAp(1:nn) * thick(1:nn)) + locChldegp = sum(vertChldegp(1:nn) * thick(1:nn)) +#endif + end if end subroutine REcoM_Forcing diff --git a/src/int_recom/recom_init.F90 b/src/int_recom/recom_init.F90 index e9b5aebbf..336247eb2 100644 --- a/src/int_recom/recom_init.F90 +++ b/src/int_recom/recom_init.F90 @@ -96,7 +96,7 @@ subroutine recom_init(tracers, partit, mesh) allocate(LocBenthos ( benthos_num )) allocate(decayBenthos ( benthos_num )) ! [1/day] Decay rate of detritus in the benthic layer allocate(PAR3D ( nl-1, node_size )) - + GloFeDust = 0.d0 AtmFeInput = 0.d0 GloNDust = 0.d0 @@ -130,9 +130,15 @@ subroutine recom_init(tracers, partit, mesh) LocBenthos = 0.d0 decayBenthos = 0.d0 - wFluxPhy = 0.d0 - wFluxDia = 0.d0 PAR3D = 0.d0 + + if (use_atbox) then + allocate(x_co2atm ( 1 )) + else + allocate(x_co2atm ( node_size )) + endif + x_co2atm = 0.d0 + ! pco2surf = 0.d0 ! dflux = 0.d0 @@ -148,28 +154,36 @@ subroutine recom_init(tracers, partit, mesh) allocate(NPPn ( node_size )) allocate(NPPd ( node_size )) allocate(NPPc ( node_size )) + allocate(NPPp ( node_size )) allocate(GPPn ( node_size )) allocate(GPPd ( node_size )) allocate(GPPc ( node_size )) + allocate(GPPp ( node_size )) allocate(NNAn ( node_size )) allocate(NNAd ( node_size )) allocate(NNAc ( node_size )) + allocate(NNAp ( node_size )) allocate(Chldegn ( node_size )) allocate(Chldegd ( node_size )) allocate(Chldegc ( node_size )) + allocate(Chldegp ( node_size )) NPPn = 0.d0 NPPd = 0.d0 NPPc = 0.d0 + NPPp = 0.d0 GPPn = 0.d0 GPPd = 0.d0 GPPc = 0.d0 + GPPp = 0.d0 NNAn = 0.d0 NNAd = 0.d0 NNAc = 0.d0 + NNAp = 0.d0 Chldegn = 0.d0 Chldegd = 0.d0 Chldegc = 0.d0 + Chldegp = 0.d0 !! *** Allocate 3D diagnostics *** allocate(respmeso ( nl-1, node_size )) @@ -180,15 +194,19 @@ subroutine recom_init(tracers, partit, mesh) allocate(aggn ( nl-1, node_size )) allocate(aggd ( nl-1, node_size )) allocate(aggc ( nl-1, node_size )) + allocate(aggp ( nl-1, node_size )) allocate(docexn ( nl-1, node_size )) allocate(docexd ( nl-1, node_size )) allocate(docexc ( nl-1, node_size )) + allocate(docexp ( nl-1, node_size )) allocate(respn ( nl-1, node_size )) allocate(respd ( nl-1, node_size )) allocate(respc ( nl-1, node_size )) + allocate(respp ( nl-1, node_size )) allocate(NPPn3D ( nl-1, node_size )) allocate(NPPd3D ( nl-1, node_size )) allocate(NPPc3D ( nl-1, node_size )) + allocate(NPPp3D ( nl-1, node_size )) respmeso = 0.d0 respmacro = 0.d0 @@ -198,15 +216,78 @@ subroutine recom_init(tracers, partit, mesh) aggn = 0.d0 aggd = 0.d0 aggc = 0.d0 + aggp = 0.d0 docexn = 0.d0 docexd = 0.d0 docexc = 0.d0 + docexp = 0.d0 respn = 0.d0 respd = 0.d0 respc = 0.d0 + respp = 0.d0 NPPn3D = 0.d0 NPPd3D = 0.d0 NPPc3D = 0.d0 + NPPp3D = 0.d0 + +!! From Hannahs new temperature function (not sure if needed as diagnostic): + + allocate(TTemp_diatoms (nl-1,node_size)) + allocate(TTemp_phyto (nl-1,node_size)) + allocate(TTemp_cocco (nl-1,node_size)) + allocate(TTemp_phaeo (nl-1,node_size)) + + TTemp_diatoms (:,:) = 0.d0 + TTemp_phyto (:,:) = 0.d0 + TTemp_cocco (:,:) = 0.d0 + TTemp_phaeo (:,:) = 0.d0 + + allocate(TPhyCO2 (nl-1,node_size)) + allocate(TDiaCO2 (nl-1,node_size)) + allocate(TCoccoCO2 (nl-1,node_size)) + allocate(TPhaeoCO2 (nl-1,node_size)) + + TPhyCO2 (:,:) = 0.d0 + TDiaCO2 (:,:) = 0.d0 + TCoccoCO2 (:,:) = 0.d0 + TPhaeoCO2 (:,:) = 0.d0 + + allocate(TqlimitFac_phyto (nl-1,node_size)) + allocate(TqlimitFac_diatoms (nl-1,node_size)) + allocate(TqlimitFac_cocco (nl-1,node_size)) + allocate(TqlimitFac_phaeo (nl-1,node_size)) + + TqlimitFac_phyto (:,:) = 0.d0 + TqlimitFac_diatoms (:,:) = 0.d0 + TqlimitFac_cocco (:,:) = 0.d0 + TqlimitFac_phaeo (:,:) = 0.d0 + + + allocate(TCphotLigLim_diatoms (nl-1,node_size)) + allocate(TCphotLigLim_phyto (nl-1,node_size)) + allocate(TCphotLigLim_cocco (nl-1,node_size)) + allocate(TCphotLigLim_phaeo (nl-1,node_size)) + + + TCphotLigLim_diatoms (:,:) = 0.d0 + TCphotLigLim_phyto (:,:) = 0.d0 + TCphotLigLim_cocco (:,:) = 0.d0 + TCphotLigLim_phaeo (:,:) = 0.d0 + + allocate(TCphot_diatoms (nl-1,node_size)) + allocate(TCphot_phyto (nl-1,node_size)) + allocate(TCphot_cocco (nl-1,node_size)) + allocate(TCphot_phaeo (nl-1,node_size)) + + TCphot_diatoms (:,:) = 0.d0 + TCphot_phyto (:,:) = 0.d0 + TCphot_cocco (:,:) = 0.d0 + TCphot_phaeo (:,:) = 0.d0 + + allocate(TSi_assimDia (nl-1,node_size)) + + TSi_assimDia (:,:) = 0.d0 + end if !! *** Allocate 3D mocsy *** @@ -246,6 +327,22 @@ subroutine recom_init(tracers, partit, mesh) Sinkingvel1(:,:) = 0.d0 Sinkingvel2(:,:) = 0.d0 + allocate(Sinkvel1_tr(nl,node_size,num_tracers), Sinkvel2_tr(nl,node_size,num_tracers)) ! OG 16.03.23 + Sinkvel1_tr(:,:,:) = 0.0d0 ! OG 16.03.23 + Sinkvel2_tr(:,:,:) = 0.0d0 ! OG 16.03.23 + + if (use_MEDUSA) then + allocate(GloSed(node_size,sedflx_num)) + allocate(SinkFlx(node_size,bottflx_num)) + allocate(SinkFlx_tr(node_size,bottflx_num,num_tracers)) ! kh 25.03.22 buffer sums per tracer index + + SinkFlx(:,:) = 0.d0 + SinkFlx_tr(:,:,:) = 0.0d0 ! kh 25.03.22 + GloSed(:,:) = 0.d0 + allocate(lb_flux(node_size,9)) + lb_flux(:,:) = 0.d0 + end if + DO i=num_tracers-bgc_num+1, num_tracers id=tracers%data(i)%ID @@ -309,7 +406,7 @@ subroutine recom_init(tracers, partit, mesh) tracers%data(i)%values(:,:) = tiny ! DetCalc ! ******************* -! CASE 2phy 2zoo 2det +! CASE 2phy 3zoo 2det ! ******************* #if defined (__3Zoo2Det) CASE (1023) @@ -327,43 +424,73 @@ subroutine recom_init(tracers, partit, mesh) #endif ! ******************* -! CASE 3phy 2zoo 2det +! CASE 4phy 3zoo 2det ! ******************* #if defined (__coccos) & defined (__3Zoo2Det) CASE (1029) tracers%data(i)%values(:,:) = tiny_chl/chl2N_max ! CoccoN + CASE (1030) tracers%data(i)%values(:,:) = tiny_chl/chl2N_max/NCmax ! CoccoC + CASE (1031) tracers%data(i)%values(:,:) = tiny_chl ! CoccoChl + + CASE (1032) + tracers%data(i)%values(:,:) = tiny_chl/chl2N_max ! PhaeoN + + CASE (1033) + tracers%data(i)%values(:,:) = tiny_chl/chl2N_max/NCmax ! PhaeoC + + CASE (1034) + tracers%data(i)%values(:,:) = tiny_chl ! PhaeoChl + + + ! ******************* -! CASE 3phy 1zoo 1det +! CASE 4phy 1zoo 1det ! ******************* #elif defined (__coccos) & !defined (__3Zoo2Det) CASE (1023) tracers%data(i)%values(:,:) = tiny_chl/chl2N_max ! CoccoN + CASE (1024) tracers%data(i)%values(:,:) = tiny_chl/chl2N_max/NCmax ! CoccoC + CASE (1025) tracers%data(i)%values(:,:) = tiny_chl ! CoccoChl + + CASE (1026) + tracers%data(i)%values(:,:) = tiny_chl/chl2N_max ! PhaeoN + + CASE (1027) + tracers%data(i)%values(:,:) = tiny_chl/chl2N_max/NCmax ! PhaeoC + + CASE (1028) + tracers%data(i)%values(:,:) = tiny_chl ! PhaeoChl + #endif ! ******************* -! CASE 3phy 3zoo 2det +! CASE 4phy 3zoo 2det ! ******************* #if defined (__coccos) & defined (__3Zoo2Det) - CASE (1032) + CASE (1035) tracers%data(i)%values(:,:) = tiny ! Zoo3N - CASE (1033) + + CASE (1036) tracers%data(i)%values(:,:) = tiny * Redfield ! Zoo3C + #elif !defined (__coccos) & defined (__3Zoo2Det) ! ******************* ! CASE 2phy 3zoo 2det ! ******************* CASE (1029) tracers%data(i)%values(:,:) = tiny ! Zoo3N + CASE (1030) tracers%data(i)%values(:,:) = tiny * Redfield ! Zoo3C + #endif END SELECT diff --git a/src/int_recom/recom_main.F90 b/src/int_recom/recom_main.F90 index c9c5575e5..6b72c9c2d 100755 --- a/src/int_recom/recom_main.F90 +++ b/src/int_recom/recom_main.F90 @@ -6,8 +6,8 @@ module recom_interface interface subroutine recom(ice, dynamics, tracers, partit, mesh) use mod_mesh - USE MOD_PARTIT - USE MOD_PARSUP + use MOD_PARTIT + use MOD_PARSUP use mod_tracer use MOD_DYN use MOD_ICE @@ -29,8 +29,8 @@ subroutine bio_fluxes(tracers, partit, mesh) use recom_config use mod_mesh - USE MOD_PARTIT - USE MOD_PARSUP + use MOD_PARTIT + use MOD_PARSUP use mod_tracer use g_config @@ -52,11 +52,12 @@ subroutine recom(ice, dynamics, tracers, partit, mesh) use MOD_MESH use MOD_TRACER use MOD_DYN - USE MOD_ICE + use MOD_ICE use o_ARRAYS use o_PARAM - USE MOD_PARTIT - USE MOD_PARSUP + use MOD_PARTIT + use MOD_PARSUP + use ieee_arithmetic use recom_declarations use bio_fluxes_interface @@ -67,7 +68,8 @@ subroutine recom(ice, dynamics, tracers, partit, mesh) use g_clock use g_forcing_arrays, only: press_air, u_wind, v_wind, shortwave use g_comm_auto - IMPLICIT NONE + + implicit none type(t_dyn) , intent(inout), target :: dynamics type(t_tracer), intent(inout), target :: tracers @@ -98,6 +100,7 @@ subroutine recom(ice, dynamics, tracers, partit, mesh) integer :: idiags real(kind=8) :: Sali + logical :: do_update = .false. real(kind=8), allocatable :: Temp(:), Sali_depth(:), zr(:), PAR(:) real(kind=8), allocatable :: C(:,:) @@ -113,6 +116,7 @@ subroutine recom(ice, dynamics, tracers, partit, mesh) real(kind=8), allocatable :: OmegaC_watercolumn(:) real(kind=8), allocatable :: kspc_watercolumn(:) real(kind=8), allocatable :: rhoSW_watercolumn(:) + real(kind=WP) :: ttf_rhs_bak (mesh%nl-1, tracers%num_tracers) ! local variable ! OG - tra_diag #include "../associate_part_def.h" #include "../associate_mesh_def.h" @@ -135,11 +139,23 @@ subroutine recom(ice, dynamics, tracers, partit, mesh) if (restore_alkalinity) call bio_fluxes(tracers, partit, mesh) if (recom_debug .and. mype==0) print *, achar(27)//'[36m'//' --> bio_fluxes'//achar(27)//'[0m' + if (use_atbox) then ! MERGE +! Prognostic atmospheric isoCO2 + call recom_atbox(partit,mesh) +! optional I/O of isoCO2 and inferred cosmogenic 14C production; this may cost some CPU time + if (ciso .and. ciso_14) then + call annual_event(do_update) + if (do_update .and. mype==0) write (*, fmt = '(a50,2x,i6,4(2x,f6.2))') & + 'Year, xCO2 (ppm), cosmic 14C flux (at / cm² / s):', & + yearold, x_co2atm(1), x_co2atm_13(1), x_co2atm_14(1), cosmic_14(1) * production_rate_to_flux_14 + end if + end if ! ====================================================================================== !********************************* LOOP STARTS ***************************************** do n=1, myDim_nod2D ! needs exchange_nod in the end -! if (ulevels_nod2D(n)>1) cycle + !!---- Skip cavity nodes - REcoM not supported in ice shelf cavities + if (ulevels_nod2D(n)>1) cycle ! nzmin = ulevels_nod2D(n) !!---- Number of vertical layers @@ -176,6 +192,32 @@ subroutine recom(ice, dynamics, tracers, partit, mesh) !!---- Atmospheric CO2 in LocVar LocAtmCO2 = AtmCO2(month) +! Update of prognostic atmospheric CO2 values + if (use_atbox) then + LocAtmCO2 = x_co2atm(1) + if (ciso) then + LocAtmCO2_13 = x_co2atm_13(1) + if (ciso_14) LocAtmCO2_14 = x_co2atm_14(1) + end if + else +! Consider prescribed atmospheric CO2 values + if (ciso) then + LocAtmCO2_13 = AtmCO2_13(month) + if (ciso_14) then +! Latitude of nodal point n + lat_val = geo_coord_nod2D(2,n) / rad +! Zonally binned NH / SH / TZ 14CO2 input values + LocAtmCO2_14 = AtmCO2_14(lat_zone(lat_val), month) + end if + end if + LocAtmCO2 = x_co2atm(n) ! from oifs + end if ! use_atbox + + if (ciso) then + r_atm_13 = LocAtmCO2_13(1) / LocAtmCO2(1) + if (ciso_14) r_atm_14 = LocAtmCO2_14(1) / LocAtmCO2(1) + end if + !!---- Shortwave penetration SW = parFrac * shortwave(n) SW = SW * (1.d0 - a_ice(n)) @@ -206,6 +248,15 @@ subroutine recom(ice, dynamics, tracers, partit, mesh) C(1:nzmax, tr_num-2) = tracers%data(tr_num)%values(1:nzmax, n) end do + ttf_rhs_bak = 0.0 ! OG - tra_diag + + + do tr_num=1, num_tracers + if (tracers%data(tr_num)%ltra_diag) then ! OG - tra_diag + ttf_rhs_bak(1:nzmax,tr_num) = tracers%data(tr_num)%values(1:nzmax, n) + end if + end do + !!---- Depth of the nodes in the water column zr(1:nzmax) = Z_3d_n(1:nzmax, n) @@ -219,30 +270,87 @@ subroutine recom(ice, dynamics, tracers, partit, mesh) if (Diags) then !! * Allocate 3D diagnostics * - allocate(vertrespmeso(nl-1), vertrespmacro(nl-1), vertrespmicro(nl-1)) + allocate(vertrespmeso(nl-1)) vertrespmeso = 0.d0 + +#if defined (__3Zoo2Det) + allocate(vertrespmacro(nl-1), vertrespmicro(nl-1)) vertrespmacro = 0.d0 vertrespmicro = 0.d0 - +#endif allocate(vertcalcdiss(nl-1), vertcalcif(nl-1)) vertcalcdiss = 0.d0 vertcalcif = 0.d0 - allocate(vertaggn(nl-1), vertaggd(nl-1), vertaggc(nl-1)) + allocate(vertaggn(nl-1), vertaggd(nl-1)) vertaggn = 0.d0 vertaggd = 0.d0 - vertaggc = 0.d0 - allocate(vertdocexn(nl-1), vertdocexd(nl-1), vertdocexc(nl-1)) + allocate(vertdocexn(nl-1), vertdocexd(nl-1)) vertdocexn = 0.d0 vertdocexd = 0.d0 - vertdocexc = 0.d0 - allocate(vertrespn(nl-1), vertrespd(nl-1), vertrespc(nl-1)) + allocate(vertrespn(nl-1), vertrespd(nl-1)) vertrespn = 0.d0 vertrespd = 0.d0 + + allocate(VTTemp_diatoms(nl-1), VTTemp_phyto(nl-1)) + VTTemp_diatoms = 0.d0 + VTTemp_phyto = 0.d0 + + allocate(VTPhyCO2(nl-1), VTDiaCO2(nl-1)) + VTPhyCO2 = 0.d0 + VTDiaCO2 = 0.d0 + + allocate(VTqlimitFac_phyto(nl-1), VTqlimitFac_diatoms(nl-1)) + VTqlimitFac_phyto = 0.d0 + VTqlimitFac_diatoms = 0.d0 + + allocate(VTCphotLigLim_phyto(nl-1), VTCphotLigLim_diatoms(nl-1)) + VTCphotLigLim_phyto = 0.d0 + VTCphotLigLim_diatoms = 0.d0 + + allocate(VTCphot_phyto(nl-1), VTCphot_diatoms(nl-1)) + VTCphot_phyto = 0.d0 + VTCphot_diatoms = 0.d0 + + allocate(VTSi_assimDia(nl-1)) + VTSi_assimDia = 0.d0 + +#if defined (__coccos) + allocate(vertaggc(nl-1), vertdocexc(nl-1), vertrespc(nl-1)) + vertaggc = 0.d0 + vertdocexc = 0.d0 vertrespc = 0.d0 + allocate(vertaggp(nl-1), vertdocexp(nl-1), vertrespp(nl-1)) ! Phaeocystis + vertaggp = 0.d0 + vertdocexp = 0.d0 + vertrespp = 0.d0 + + allocate(VTTemp_cocco(nl-1), VTTemp_phaeo(nl-1)) + VTTemp_cocco = 0.d0 + VTTemp_phaeo = 0.d0 + + allocate(VTCoccoCO2(nl-1), VTPhaeoCO2(nl-1)) + VTCoccoCO2 = 0.d0 + VTPhaeoCO2 = 0.d0 + + allocate(VTqlimitFac_cocco(nl-1), VTqlimitFac_phaeo(nl-1)) + VTqlimitFac_cocco = 0.d0 + VTqlimitFac_phaeo = 0.d0 + + allocate(VTCphotLigLim_cocco(nl-1), VTCphotLigLim_phaeo(nl-1)) + VTCphotLigLim_cocco = 0.d0 + VTCphotLigLim_phaeo = 0.d0 + + allocate(VTCphot_cocco(nl-1), VTCphot_phaeo(nl-1)) + VTCphot_cocco = 0.d0 + VTCphot_phaeo = 0.d0 + + +#endif + !! * Allocate 2D diagnostics * allocate(vertNPPn(nl-1), vertGPPn(nl-1), vertNNAn(nl-1), vertChldegn(nl-1)) vertNPPn = 0.d0 @@ -256,18 +364,26 @@ subroutine recom(ice, dynamics, tracers, partit, mesh) vertNNAd = 0.d0 vertChldegd = 0.d0 +#if defined (__coccos) allocate(vertNPPc(nl-1), vertGPPc(nl-1), vertNNAc(nl-1), vertChldegc(nl-1)) vertNPPc = 0.d0 vertGPPc = 0.d0 vertNNAc = 0.d0 - vertChldegc = 0.d0 + vertChldegc = 0.d0 + + allocate(vertNPPp(nl-1), vertGPPp(nl-1), vertNNAp(nl-1), vertChldegp(nl-1)) + vertNPPp = 0.d0 + vertGPPp = 0.d0 + vertNNAp = 0.d0 + vertChldegp = 0.d0 +#endif end if if (recom_debug .and. mype==0) print *, achar(27)//'[36m'//' --> REcoM_Forcing'//achar(27)//'[0m' ! ====================================================================================== !******************************** RECOM FORCING **************************************** - call REcoM_Forcing(zr, n, nzmax, C, SW, Loc_slp , Temp, Sali, Sali_depth & + call REcoM_Forcing(zr, n, nzmax, C, SW, Loc_slp, Temp, Sali, Sali_depth & , CO2_watercolumn & ! NEW MOCSY CO2 for the whole watercolumn , pH_watercolumn & ! NEW MOCSY pH for the whole watercolumn , pCO2_watercolumn & ! NEW MOCSY pCO2 for the whole watercolumn @@ -282,6 +398,16 @@ subroutine recom(ice, dynamics, tracers, partit, mesh) tracers%data(tr_num)%values(1:nzmax, n) = C(1:nzmax, tr_num-2) end do + ! recom_sms + + do tr_num=1, num_tracers + if (tracers%data(tr_num)%ltra_diag) then ! OG - tra_diag + tracers%work%tra_recom_sms(1:nzmax,n,tr_num) = tracers%data(tr_num)%values(1:nzmax, n) - ttf_rhs_bak(1:nzmax,tr_num) + !if (mype==0) print *, tra_recom_sms(:,:,tr_num) + end if + + end do + !!---- Local variables that have been changed during the time-step are stored so they can be saved Benthos(n,1:benthos_num) = LocBenthos(1:benthos_num) GlodecayBenthos(n, 1:benthos_num) = decayBenthos(1:benthos_num)/SecondsPerDay ! convert from [mmol/m2/d] to [mmol/m2/s] @@ -291,48 +417,114 @@ subroutine recom(ice, dynamics, tracers, partit, mesh) !! * Update 2D diagnostics * NPPn(n) = locNPPn NPPd(n) = locNPPd - NPPc(n) = locNPPc GPPn(n) = locGPPn GPPd(n) = locGPPd - GPPc(n) = locGPPc NNAn(n) = locNNAn NNAd(n) = locNNAd - NNAc(n) = locNNAc Chldegn(n) = locChldegn Chldegd(n) = locChldegd + +#if defined (__coccos) + NPPc(n) = locNPPc + GPPc(n) = locGPPc + NNAc(n) = locNNAc Chldegc(n) = locChldegc + NPPp(n) = locNPPp + GPPp(n) = locGPPp + NNAp(n) = locNNAp + Chldegp(n) = locChldegp +#endif !! * Update 3D diagnostics * respmeso (1:nzmax,n) = vertrespmeso (1:nzmax) +#if defined (__3Zoo2Det) respmacro (1:nzmax,n) = vertrespmacro (1:nzmax) respmicro (1:nzmax,n) = vertrespmicro (1:nzmax) +#endif calcdiss (1:nzmax,n) = vertcalcdiss (1:nzmax) calcif (1:nzmax,n) = vertcalcif (1:nzmax) + aggn (1:nzmax,n) = vertaggn (1:nzmax) - aggd (1:nzmax,n) = vertaggd (1:nzmax) - aggc (1:nzmax,n) = vertaggc (1:nzmax) docexn (1:nzmax,n) = vertdocexn (1:nzmax) - docexd (1:nzmax,n) = vertdocexd (1:nzmax) - docexc (1:nzmax,n) = vertdocexc (1:nzmax) respn (1:nzmax,n) = vertrespn (1:nzmax) - respd (1:nzmax,n) = vertrespd (1:nzmax) - respc (1:nzmax,n) = vertrespc (1:nzmax) NPPn3D (1:nzmax,n) = vertNPPn (1:nzmax) + + aggd (1:nzmax,n) = vertaggd (1:nzmax) + docexd (1:nzmax,n) = vertdocexd (1:nzmax) + respd (1:nzmax,n) = vertrespd (1:nzmax) NPPd3D (1:nzmax,n) = vertNPPd (1:nzmax) + + TTemp_phyto (1:nzmax,n) = VTTemp_phyto (1:nzmax) + TPhyCO2 (1:nzmax,n) = VTPhyCO2 (1:nzmax) + TqlimitFac_phyto (1:nzmax,n) = VTqlimitFac_phyto (1:nzmax) + TCphotLigLim_phyto (1:nzmax,n) = VTCphotLigLim_phyto (1:nzmax) + TCphot_phyto (1:nzmax,n) = VTCphot_phyto (1:nzmax) + + TTemp_diatoms (1:nzmax,n) = VTTemp_diatoms (1:nzmax) !! NEW from here tracking vars + TDiaCO2 (1:nzmax,n) = VTDiaCO2 (1:nzmax) + TqlimitFac_diatoms (1:nzmax,n) = VTqlimitFac_diatoms (1:nzmax) + TCphotLigLim_diatoms(1:nzmax,n) = VTCphotLigLim_diatoms (1:nzmax) + TCphot_diatoms (1:nzmax,n) = VTCphot_diatoms (1:nzmax) + + TSi_assimDia (1:nzmax,n) = VTSi_assimDia (1:nzmax) + +#if defined (__coccos) + aggc (1:nzmax,n) = vertaggc (1:nzmax) + docexc (1:nzmax,n) = vertdocexc (1:nzmax) + respc (1:nzmax,n) = vertrespc (1:nzmax) NPPc3D (1:nzmax,n) = vertNPPc (1:nzmax) + + aggp (1:nzmax,n) = vertaggp (1:nzmax) + docexp (1:nzmax,n) = vertdocexp (1:nzmax) + respp (1:nzmax,n) = vertrespp (1:nzmax) + NPPp3D (1:nzmax,n) = vertNPPp (1:nzmax) + + TTemp_cocco (1:nzmax,n) = VTTemp_cocco (1:nzmax) + TCoccoCO2 (1:nzmax,n) = VTCoccoCO2 (1:nzmax) + TqlimitFac_cocco (1:nzmax,n) = VTqlimitFac_cocco (1:nzmax) + TCphotLigLim_cocco (1:nzmax,n) = VTCphotLigLim_cocco (1:nzmax) + TCphot_cocco (1:nzmax,n) = VTCphot_cocco (1:nzmax) + + TTemp_phaeo (1:nzmax,n) = VTTemp_phaeo (1:nzmax) + TPhaeoCO2 (1:nzmax,n) = VTPhaeoCO2 (1:nzmax) + TqlimitFac_phaeo (1:nzmax,n) = VTqlimitFac_phaeo (1:nzmax) + TCphotLigLim_phaeo (1:nzmax,n) = VTCphotLigLim_phaeo (1:nzmax) + TCphot_phaeo (1:nzmax,n) = VTCphot_phaeo (1:nzmax) + +#endif + if (recom_debug .and. mype==0) print *, achar(27)//'[36m'//' --> ciso after REcoM_Forcing'//achar(27)//'[0m' !! * Deallocating 2D diagnostics * deallocate(vertNPPn, vertGPPn, vertNNAn, vertChldegn) deallocate(vertNPPd, vertGPPd, vertNNAd, vertChldegd) - deallocate(vertNPPc, vertGPPc, vertNNAc, vertChldegc) +#if defined (__coccos) + deallocate(vertNPPc,vertGPPc,vertNNAc,vertChldegc) + deallocate(vertNPPp,vertGPPp,vertNNAp,vertChldegp) +#endif !! * Deallocating 3D Diagnostics * - deallocate(vertrespmeso, vertrespmacro, vertrespmicro ) - deallocate(vertcalcdiss, vertcalcif ) - deallocate(vertaggn, vertaggd, vertaggc ) - deallocate(vertdocexn, vertdocexd, vertdocexc ) - deallocate(vertrespn, vertrespd, vertrespc ) + deallocate(vertrespmeso) +#if defined (__3Zoo2Det) + deallocate(vertrespmacro, vertrespmicro) +#endif + deallocate(vertcalcdiss, vertcalcif) + deallocate(vertaggn, vertdocexn, vertrespn) + deallocate(vertaggd, vertdocexd, vertrespd) + + deallocate(VTTemp_phyto, VTPhyCO2, VTqlimitFac_phyto, VTCphotLigLim_phyto, VTCphot_phyto) ! NEW + deallocate(VTTemp_diatoms, VTDiaCO2, VTqlimitFac_diatoms, VTCphotLigLim_diatoms, VTCphot_diatoms) + + deallocate(VTSi_assimDia) + +#if defined (__coccos) + deallocate(vertaggc, vertdocexc, vertrespc) + deallocate(vertaggp, vertdocexp, vertrespp) + + deallocate(VTTemp_cocco, VTCoccoCO2, VTqlimitFac_cocco, VTCphotLigLim_cocco, VTCphot_cocco) + deallocate(VTTemp_phaeo, VTPhaeoCO2, VTqlimitFac_phaeo, VTCphotLigLim_phaeo, VTCphot_phaeo) + +#endif end if @@ -345,6 +537,12 @@ subroutine recom(ice, dynamics, tracers, partit, mesh) GloCO2flux(n) = dflux(1) ! [mmol/m2/d] GloCO2flux_seaicemask(n) = co2flux_seaicemask(1) ! [mmol/m2/s] GloO2flux_seaicemask(n) = o2flux_seaicemask(1) ! [mmol/m2/s] + if (ciso) then + GloCO2flux_seaicemask_13(n) = co2flux_seaicemask_13(1) ! [mmol/m2/s] + if (ciso_14) then + GloCO2flux_seaicemask_14(n) = co2flux_seaicemask_14(1) ! [mmol/m2/s] + end if + end if GloO2flux(n) = oflux(1) ! [mmol/m2/d] PAR3D(1:nzmax,n) = PAR(1:nzmax) @@ -375,6 +573,16 @@ subroutine recom(ice, dynamics, tracers, partit, mesh) call exchange_nod(GloCO2flux_seaicemask, partit) call exchange_nod(GloO2flux_seaicemask, partit) + if (ciso) then + call exchange_nod(GloPCO2surf_13, partit) + call exchange_nod(GloCO2flux_13, partit) + call exchange_nod(GloCO2flux_seaicemask_13, partit) + if (ciso_14) then + call exchange_nod(GloPCO2surf_14, partit) + call exchange_nod(GloCO2flux_14, partit) + call exchange_nod(GloCO2flux_seaicemask_14, partit) + end if + end if do n=1, benthos_num call exchange_nod(Benthos(:,n), partit) end do @@ -388,10 +596,16 @@ subroutine recom(ice, dynamics, tracers, partit, mesh) call exchange_nod(NNAd, partit) call exchange_nod(Chldegn, partit) call exchange_nod(Chldegd, partit) +#if defined (__coccos) call exchange_nod(NPPc, partit) call exchange_nod(GPPc, partit) call exchange_nod(NNAc, partit) call exchange_nod(Chldegc, partit) + call exchange_nod(NPPp, partit) + call exchange_nod(GPPp, partit) + call exchange_nod(NNAp, partit) + call exchange_nod(Chldegp, partit) +#endif endif do n=1, benthos_num @@ -412,6 +626,7 @@ subroutine recom(ice, dynamics, tracers, partit, mesh) call exchange_nod(OmegaC3D, partit) call exchange_nod(kspc3D, partit) call exchange_nod(rhoSW3D, partit) + end subroutine recom ! ====================================================================================== @@ -423,10 +638,11 @@ subroutine bio_fluxes(tracers, partit, mesh) use recom_locvar use recom_glovar use recom_config - + use o_PARAM + use ieee_arithmetic use mod_mesh - USE MOD_PARTIT - USE MOD_PARSUP + use MOD_PARTIT + use MOD_PARSUP use mod_tracer use g_config @@ -496,4 +712,4 @@ subroutine bio_fluxes(tracers, partit, mesh) relax_alk=relax_alk-net/ocean_area ! at ocean surface layer -end subroutine bio_fluxes \ No newline at end of file +end subroutine bio_fluxes diff --git a/src/int_recom/recom_modules.F90 b/src/int_recom/recom_modules.F90 index c4113377c..73c6e7b6a 100644 --- a/src/int_recom/recom_modules.F90 +++ b/src/int_recom/recom_modules.F90 @@ -40,22 +40,24 @@ module recom_config #if defined (__coccos) & defined (__3Zoo2Det) ! ******************* -! CASE 3phy 2zoo 2det +! CASE 4phy 2zoo 2det ! ******************* Integer :: icocn = 29, icocc = 30, icchl = 31 + Integer :: iphan = 32, iphac = 33, iphachl = 34 #elif defined (__coccos) & !defined (__3Zoo2Det) ! ******************* -! CASE 3phy 1zoo 1det +! CASE 4phy 1zoo 1det ! ******************* Integer :: icocn = 23, icocc = 24, icchl = 25 + Integer :: iphan = 26, iphac = 27, iphachl = 28 #endif #if defined (__coccos) & defined (__3Zoo2Det) ! ******************* -! CASE 3phy 3zoo 2det +! CASE 4phy 3zoo 2det ! ******************* - Integer :: imiczoon = 32, imiczooc = 33 + Integer :: imiczoon = 35, imiczooc = 36 #elif !defined (__coccos) & defined (__3Zoo2Det) ! ******************* @@ -66,7 +68,7 @@ module recom_config !============================================================================= - Integer :: ivphy = 1, ivdia = 2, ivdet = 3, ivdetsc = 4, ivcoc = 5 + Integer :: ivphy = 1, ivdia = 2, ivdet = 3, ivdetsc = 4, ivcoc = 5, ivpha = 6 !============================================================================= @@ -74,9 +76,10 @@ module recom_config ! OG ! Todo: Make recom_sinking_tracer_id case sensitive - integer, dimension(29) :: recom_sinking_tracer_id = (/1007, 1008, 1017, 1021, 1004, 1005, 1020, 1006, & + integer, dimension(32) :: recom_sinking_tracer_id = (/1007, 1008, 1017, 1021, 1004, 1005, 1020, 1006, & 1013, 1014, 1016, 1015, 1025, 1026, 1027, 1028, & 1029, 1030, 1031, & + 1032, 1033, 1034, & 1308, 1321, 1305, 1320, & 1314, 1408, 1421, 1405, 1420, 1414/) integer, dimension(8) :: recom_det_tracer_id = (/1007, 1008, 1017, 1021, 1308, 1321, 1408, 1421/) @@ -85,9 +88,12 @@ module recom_config #if defined (__coccos) & defined (__3Zoo2Det) integer, dimension(3) :: recom_cocco_tracer_id = (/1029, 1030, 1031/) + integer, dimension(3) :: recom_phaeo_tracer_id = (/1032, 1033, 1034/) + #elif defined (__coccos) & !defined (__3Zoo2Det) integer, dimension(3) :: recom_cocco_tracer_id = (/1023, 1024, 1025/) + integer, dimension(3) :: recom_phaeo_tracer_id = (/1026, 1027, 1028/) #endif #if defined (__3Zoo2Det) @@ -109,14 +115,15 @@ module recom_config Logical :: use_REcoM = .true. Logical :: REcoM_restart = .false. - Integer :: bgc_num = 33 ! NEW increased the number from 28 to 34 (added coccos and respiration) ! NEW 3Zoo changed from 31 to 33 + Integer :: bgc_num = 36 ! NEW increased the number from 28 to 34 (added coccos and respiration) ! NEW 3Zoo changed from 31 to 33 ! added phaeocystis: changed from 33 to 36 integer :: bgc_base_num = 22 ! standard tracers - Integer :: diags3d_num = 28 ! Number of diagnostic 3d tracers to be saved + Integer :: diags3d_num = 31 ! Number of diagnostic 3d tracers to be saved Real(kind=8) :: VDet = 20.d0 ! Sinking velocity, constant through the water column and positive downwards Real(kind=8) :: VDet_zoo2 = 200.d0 ! Sinking velocity, constant through the water column Real(kind=8) :: VPhy = 0.d0 !!! If the number of sinking velocities are different from 3, code needs to be changed !!! Real(kind=8) :: VDia = 0.d0 Real(kind=8) :: VCocco = 0.d0 ! NEW + Real(kind=8) :: VPhaeo = 0.d0 ! Phaeocystis Logical :: allow_var_sinking = .true. Integer :: biostep = 1 ! Number of times biology should be stepped forward for each time step Logical :: REcoM_Geider_limiter = .false. ! Decides what routine should be used to calculate limiters in sms @@ -168,6 +175,7 @@ module recom_config bgc_num, diags3d_num, bgc_base_num, & VDet, VDet_zoo2, & VPhy, VDia, VCocco, & + VPhaeo, & allow_var_sinking, biostep, REcoM_Geider_limiter, & REcoM_Grazing_Variable_Preference, & Grazing_detritus, & @@ -201,13 +209,31 @@ module recom_config namelist /painitialization_N/ cPhyN, cHetN, cZoo2N !!------------------------------------------------------------------------------ -!! *** Arrhenius function *** +!! *** Temperature and Arrhenius functions *** Real(kind=8) :: recom_Tref = 288.15d0 ! [K] Real(kind=8) :: C2K = 273.15d0 ! Conversion from degrees C to K Real(kind=8) :: Ae = 4500.d0 ! [K] Slope of the linear part of the Arrhenius function + +!! *** Temperature variables for Blanchard function *** + Real(kind=8) :: Tmax_phaeo = 16d0 ! [degC] For Blanchard temp fxn: maximum temperature + Real(kind=8) :: Topt_phaeo = 7.5272d0 ! [degC] For Blanchard temp fxn: optimum temperature + Real(kind=8) :: uopt_phaeo = 0.7328d0 ! [1/day] For Blanchard function: optimum growth date + Real(kind=8) :: beta_phaeo = 0.7829d0 ! [unitless] For Blanchard function + +! NEW MODIFIED parameters + Real(kind=8) :: ord_d = -0.2216d0 ! parameters for diatom temperature function + Real(kind=8) :: expon_d = 0.0406d0 ! diatom exponent + Real(kind=8) :: ord_phy = -1.2154d0 ! small phyto ordonnee + Real(kind=8) :: expon_phy = 0.0599d0 ! small phyto exponent + Real(kind=8) :: ord_cocco = -0.2310d0 ! coccolith ordonnee + Real(kind=8) :: expon_cocco = 0.0327d0 ! small phyto ordonnee + Real(kind=8) :: ord_phaeo = -0.2310d0 ! phaeocystis ordonnee + Real(kind=8) :: expon_phaeo = 0.0327d0 ! phaeocystis ordonnee + Real(kind=8) :: reminSi = 0.02d0 Real(kind=8) :: k_o2_remin = 15.d0 ! NEW O2remin mmol m-3; Table 1 in Cram 2018 cites DeVries & Weber 2017 for a range of 0-30 mmol m-3 - namelist /paArrhenius/ recom_Tref, C2K, Ae, reminSi, k_o2_remin + namelist /paArrhenius/ recom_Tref, C2K, Ae, Tmax_phaeo, Topt_phaeo, uopt_phaeo, beta_phaeo, ord_d, expon_d, ord_phy, expon_phy, ord_cocco, expon_cocco, ord_phaeo, expon_phaeo, reminSi, k_o2_remin + !!------------------------------------------------------------------------------ !! *** For limiter function *** Real(kind=8) :: NMinSlope = 50.d0 @@ -215,15 +241,19 @@ module recom_config Real(kind=8) :: NCmin = 0.04d0 Real(kind=8) :: NCmin_d = 0.04d0 Real(kind=8) :: NCmin_c = 0.04d0 ! NEW + Real(kind=8) :: NCmin_p = 0.04d0 ! Phaeocystis Real(kind=8) :: SiCmin = 0.04d0 Real(kind=8) :: k_Fe = 0.04d0 Real(kind=8) :: k_Fe_d = 0.12d0 Real(kind=8) :: k_Fe_c = 0.04 ! NEW + Real(kind=8) :: k_Fe_p = 0.09 ! Phaeocystis (to be tuned) Real(kind=8) :: k_si = 4.d0 Real(kind=8) :: P_cm = 3.0d0 ! [1/day] the rate of C-specific photosynthesis Real(kind=8) :: P_cm_d = 3.5d0 Real(kind=8) :: P_cm_c = 3.3d0 ! NEW - namelist /palimiter_function/ NMinSlope, SiMinSlope, NCmin, NCmin_d, NCmin_c, SiCmin, k_Fe, k_Fe_d, k_Fe_c, k_si, P_cm, P_cm_d, P_cm_c + Real(kind=8) :: P_cm_p = 3.4d0 ! NEW for Phaeocystis ( to be tuned) + namelist /palimiter_function/ NMinSlope, SiMinSlope, NCmin, NCmin_d, NCmin_c, NCmin_p, SiCmin, k_Fe, k_Fe_d, k_Fe_c, k_Fe_p, k_si, P_cm, P_cm_d, P_cm_c, P_cm_p + !!------------------------------------------------------------------------------ !! *** For light calculations *** Real(kind=8) :: k_w = 0.04d0 ! [1/m] Light attenuation coefficient @@ -231,40 +261,47 @@ module recom_config namelist /palight_calculations/ k_w, a_chl !!------------------------------------------------------------------------------ !! *** Photosynthesis *** - Real(kind=8) :: alfa = 0.14d0 ! [(mmol C*m2)/(mg Chl*W*day)] + Real(kind=8) :: alfa = 0.14d0 ! [(mmol C*m2)/(mg Chl*W*day)] Real(kind=8) :: alfa_d = 0.19d0 ! An initial slope of the P-I curve Real(kind=8) :: alfa_c = 0.10d0 ! NEW + Real(kind=8) :: alfa_p = 0.10d0 ! Phaeocystis (to be tuned) Real(kind=8) :: parFrac = 0.43d0 - namelist /paphotosynthesis/ alfa, alfa_d, alfa_c, parFrac + namelist /paphotosynthesis/ alfa, alfa_d, alfa_c, alfa_p, parFrac !!------------------------------------------------------------------------------ !! *** Assimilation *** Real(kind=8) :: V_cm_fact = 0.7d0 ! scaling factor for temperature dependent maximum of C-specific N-uptake Real(kind=8) :: V_cm_fact_d = 0.7d0 - Real(kind=8) :: V_cm_fact_c = 0.7d0 ! NEW + Real(kind=8) :: V_cm_fact_c = 0.7d0 ! NEW + Real(kind=8) :: V_cm_fact_p = 0.7d0 ! Phaeocystis Real(kind=8) :: NMaxSlope = 1000.d0 ! Max slope for limiting function Real(kind=8) :: SiMaxSlope = 1000.d0 Real(kind=8) :: NCmax = 0.2d0 ! [mmol N/mmol C] Maximum cell quota of nitrogen (N:C) Real(kind=8) :: NCmax_d = 0.2d0 Real(kind=8) :: NCmax_c = 0.15d0 ! NEW + Real(kind=8) :: NCmax_p = 0.1d0 ! Phaeocystis (to be tuned) Real(kind=8) :: SiCmax = 0.8d0 Real(kind=8) :: NCuptakeRatio = 0.2d0 ! [mmol N/mmol C] Maximum uptake ratio of N:C Real(kind=8) :: NCUptakeRatio_d = 0.2d0 Real(kind=8) :: NCUptakeRatio_c = 0.2d0 ! NEW + Real(kind=8) :: NCUptakeRatio_p = 0.2d0 ! Phaeocystis Real(kind=8) :: SiCUptakeRatio = 0.2d0 Real(kind=8) :: k_din = 0.55d0 ! [mmol N/m3] Half-saturation constant for nitrate uptake Real(kind=8) :: k_din_d = 1.0d0 Real(kind=8) :: k_din_c = 0.55d0 ! NEW + Real(kind=8) :: k_din_p = 0.55d0 ! Phaeocystis (to be tuned) Real(kind=8) :: Chl2N_max = 3.15d0 ! [mg CHL/mmol N] Maximum CHL a : N ratio = 0.3 gCHL gN^-1 Real(kind=8) :: Chl2N_max_d = 4.2d0 Real(kind=8) :: Chl2N_max_c = 3.5d0 ! NEW + Real(kind=8) :: Chl2N_max_p = 3.5d0 ! Phaeocystis (to be tuned (?)) Real(kind=8) :: res_phy = 0.01d0 ! [1/day] Maintenance respiration rate constant Real(kind=8) :: res_phy_d = 0.01d0 Real(kind=8) :: res_phy_c = 0.0075d0 ! NEW + Real(kind=8) :: res_phy_p = 0.008d0 ! Phaeocystis (to be tuned (?)) Real(kind=8) :: biosynth = 2.33d0 ! [mmol C/mmol N] Cost of biosynthesis Real(kind=8) :: biosynthSi = 0.d0 - namelist /paassimilation/ V_cm_fact, V_cm_fact_d, V_cm_fact_c, NMaxSlope, SiMaxSlope, NCmax, NCmax_d, NCmax_c, SiCmax, & - NCuptakeRatio, NCUptakeRatio_d, NCUptakeRatio_c, SiCUptakeRatio, k_din, k_din_d, k_din_c, & - Chl2N_max, Chl2N_max_d, Chl2N_max_c, res_phy, res_phy_d, res_phy_c, biosynth, biosynthSi + namelist /paassimilation/ V_cm_fact, V_cm_fact_d, V_cm_fact_c, V_cm_fact_p, NMaxSlope, SiMaxSlope, NCmax, NCmax_d, NCmax_c, NCmax_p, SiCmax, & + NCuptakeRatio, NCUptakeRatio_d, NCUptakeRatio_c, NCUptakeRatio_p, SiCUptakeRatio, k_din, k_din_d, k_din_c, k_din_p, & + Chl2N_max, Chl2N_max_d, Chl2N_max_c, Chl2N_max_p, res_phy, res_phy_d, res_phy_c, res_phy_p, biosynth, biosynthSi !!------------------------------------------------------------------------------ !! *** Iron chemistry *** Real(kind=8) :: totalligand = 1.d0 ! [mumol/m3] order 1. Total free ligand @@ -283,26 +320,30 @@ module recom_config Real(kind=8) :: sPhyNsq = 0.d0 Real(kind=8) :: pzCocco = 0.5d0 ! NEW (value is just a guess) Real(kind=8) :: sCoccoNsq = 0.d0 ! NEW + Real(kind=8) :: pzPhaeo = 1.0d0 ! Phaeocystis (to be tuned) + Real(kind=8) :: sPhaeoNsq = 0.d0 ! Phaeocystis Real(kind=8) :: pzMicZoo = 1.0d0 ! NEW 3Zoo Maximum nano-phytoplankton preference Real(kind=8) :: sMicZooNsq = 0.d0 ! NEW 3Zoo real(kind=8) :: tiny_het = 1.d-5 ! for more stable computation of HetRespFlux (_plus). Value can be > tiny because HetRespFlux ~ hetC**2. - namelist /pazooplankton/ graz_max, epsilonr, res_het, Redfield, loss_het, pzDia, sDiaNsq, pzPhy, sPhyNsq, pzCocco, sCoccoNsq, pzMicZoo, sMicZooNsq, tiny_het + namelist /pazooplankton/ graz_max, epsilonr, res_het, Redfield, loss_het, pzDia, sDiaNsq, pzPhy, sPhyNsq, pzCocco, sCoccoNsq, pzPhaeo, sPhaeoNsq, pzMicZoo, sMicZooNsq, tiny_het !!------------------------------------------------------------------------------- -!! *** SecondZooplankton *** +!! *** SecondZooplankton (Macrozooplankton) *** Real(kind=8) :: graz_max2 = 0.1d0 ! [mmol N/(m3 * day)] Maximum grazing loss parameter Real(kind=8) :: epsilon2 = 0.0144d0 ! [(mmol N)2 /m6] Half saturation constant for grazing loss Real(kind=8) :: res_zoo2 = 0.0107d0 ! [1/day] Respiration by heterotrophs and mortality (loss to detritus) Real(kind=8) :: loss_zoo2 = 0.003d0 ! [1/day] Temperature dependent N degradation of extracellular organic N - Real(kind=8) :: fecal_rate_n = 0.13d0 + Real(kind=8) :: fecal_rate_n = 0.13d0 Real(kind=8) :: fecal_rate_c = 0.295d0 Real(kind=8) :: fecal_rate_n_mes = 0.25d0 ! NEW 3Zoo - Real(kind=8) :: fecal_rate_c_mes = 0.32d0 ! NEW 3Zoo + Real(kind=8) :: fecal_rate_c_mes = 0.32d0 ! NEW 3Zoo Real(kind=8) :: pzDia2 = 1.d0 ! Maximum diatom preference Real(kind=8) :: sDiaNsq2 = 0.d0 Real(kind=8) :: pzPhy2 = 0.5d0 ! Maximum diatom preference Real(kind=8) :: sPhyNsq2 = 0.d0 Real(kind=8) :: pzCocco2 = 0.2d0 ! NEW (value is just a guess) Real(kind=8) :: sCoccoNsq2 = 0.d0 ! NEW + Real(kind=8) :: pzPhaeo2 = 0.5d0 ! Phaeocystis (to be tuned) + Real(kind=8) :: sPhaeoNsq2 = 0.d0 ! Phaeocystis Real(kind=8) :: pzHet = 0.8d0 ! Maximum diatom preference Real(kind=8) :: sHetNsq = 0.d0 Real(kind=8) :: pzMicZoo2 = 0.8d0 ! NEW Zoo3 Maximum microzooplankton preference @@ -313,7 +354,7 @@ module recom_config Real(kind=8) :: t4_zoo2 = 274.15d0 ! Krill temp. function constant3 namelist /pasecondzooplankton/ graz_max2, epsilon2, res_zoo2, & loss_zoo2, fecal_rate_n, fecal_rate_c, fecal_rate_n_mes, fecal_rate_c_mes, & ! NEW 3Zoo - pzDia2, sDiaNsq2, pzPhy2, sPhyNsq2, pzCocco2, sCoccoNsq2, pzHet, sHetNsq, & + pzDia2, sDiaNsq2, pzPhy2, sPhyNsq2, pzCocco2, sCoccoNsq2, pzPhaeo2, sPhaeoNsq2, pzHet, sHetNsq, & pzMicZoo2, sMicZooNsq2, & t1_zoo2, t2_zoo2, t3_zoo2, t4_zoo2 !------------------------------------------------------------------------------- @@ -328,7 +369,9 @@ module recom_config Real(kind=8) :: sPhyNsq3 = 0.d0 ! NEW 3Zoo Real(kind=8) :: pzCocco3 = 0.d0 ! NEW 3Zoo Maximum coccolithophore preference ! ATTENTION: This value needs to be tuned; I start with zero preference! Real(kind=8) :: sCoccoNsq3 = 0.d0 ! NEW 3Zoo - namelist /pathirdzooplankton/ graz_max3, epsilon3, loss_miczoo, res_miczoo, pzDia3, sDiaNsq3, pzPhy3, sPhyNsq3, pzCocco3, sCoccoNsq3 + Real(kind=8) :: pzPhaeo3 = 1.0d0 ! Phaeocystis 3Zoo Maximum phaeocystis preference (to be tuned (?)) + Real(kind=8) :: sPhaeoNsq3 = 0.d0 ! Phaeocystis 3Zoo + namelist /pathirdzooplankton/ graz_max3, epsilon3, loss_miczoo, res_miczoo, pzDia3, sDiaNsq3, pzPhy3, sPhyNsq3, pzCocco3, sCoccoNsq3, pzPhaeo3, sPhaeoNsq3 !------------------------------------------------------------------------------- !! *** Detritus Grazing Params *** @@ -359,20 +402,23 @@ module recom_config !! *** Phytoplankton N *** Real(kind=8) :: lossN = 0.05d0 ! [1/day] Phytoplankton loss of organic N compounds Real(kind=8) :: lossN_d = 0.05d0 - Real(kind=8) :: lossN_c = 0.05d0 - namelist /paphytoplankton_N/ lossN, lossN_d, lossN_c + Real(kind=8) :: lossN_c = 0.05d0 + Real(kind=8) :: lossN_p = 0.05d0 ! Phaeocystis + namelist /paphytoplankton_N/ lossN, lossN_d, lossN_c, lossN_p !!------------------------------------------------------------------------------ !! *** Phytoplankton C *** Real(kind=8) :: lossC = 0.10d0 ! [1/day] Phytoplankton loss of carbon Real(kind=8) :: lossC_d = 0.10d0 Real(kind=8) :: lossC_c = 0.10d0 - namelist /paphytoplankton_C/ lossC, lossC_d, lossC_c + Real(kind=8) :: lossC_p = 0.10d0 ! Phaeocystis + namelist /paphytoplankton_C/ lossC, lossC_d, lossC_c, lossC_p !!------------------------------------------------------------------------------ !! *** Phytoplankton ChlA *** Real(8) :: deg_Chl = 0.25d0 ! [1/day] Real(kind=8) :: deg_Chl_d = 0.25d0 Real(kind=8) :: deg_Chl_c = 0.20d0 ! (value is just a guess) - namelist /paphytoplankton_ChlA/ deg_Chl, deg_Chl_d, deg_Chl_c + Real(kind=8) :: deg_Chl_p = 0.25d0 ! Phaeocystis + namelist /paphytoplankton_ChlA/ deg_Chl, deg_Chl_d, deg_Chl_c, deg_Chl_p !!------------------------------------------------------------------------------ !! *** Detritus N *** Real(kind=8) :: gfin = 0.3d0 ! 3Zoo [] Grazing efficiency (fraction of grazing flux into zooplankton pool) @@ -405,32 +451,36 @@ module recom_config Real(kind=8) :: Cunits = 976.5625 ! Conversion factor between [mol/m3] (model) and [umol/kg] (function): (1000 * 1000) / 1024 Real(kind=8) :: a_co2_phy = 1.162e+00 ! [unitless] - Real(kind=8) :: a_co2_dia = 1.040e+00 ! [unitless] - Real(kind=8) :: a_co2_cocco = 1.109e+00 ! [unitless] - Real(kind=8) :: a_co2_calc = 1.102e+00 ! [unitless] - Real(kind=8) :: b_co2_phy = 4.888e+01 ! [mol/kg] + Real(kind=8) :: a_co2_dia = 1.040e+00 ! [unitless] + Real(kind=8) :: a_co2_cocco = 1.109e+00 ! [unitless] + Real(kind=8) :: a_co2_phaeo = 1.162e+00 ! [unitless] + Real(kind=8) :: a_co2_calc = 1.102e+00 ! [unitless] + Real(kind=8) :: b_co2_phy = 4.888e+01 ! [mol/kg] Real(kind=8) :: b_co2_dia = 2.890e+01 ! [mol/kg] Real(kind=8) :: b_co2_cocco = 3.767e+01 ! [mol/kg] + Real(kind=8) :: b_co2_phaeo = 4.888e+01 ! [mol/kg] Real(kind=8) :: b_co2_calc = 4.238e+01 ! [mol/kg] Real(kind=8) :: c_co2_phy = 2.255e-01 ! [kg/mol] - Real(kind=8) :: c_co2_dia = 8.778e-01 ! [kg/mol] - Real(kind=8) :: c_co2_cocco = 3.912e-01 ! [kg/mol] - Real(kind=8) :: c_co2_calc = 7.079e-01 ! [kg/mol] - Real(kind=8) :: d_co2_phy = 1.023e+07 ! [kg/mol] - Real(kind=8) :: d_co2_dia = 2.640e+06 ! [kg/mol] - Real(kind=8) :: d_co2_cocco = 9.450e+06 ! [kg/mol] - Real(kind=8) :: d_co2_calc = 1.343e+07 ! [kg/mol] - namelist /paco2lim/ Cunits, a_co2_phy, a_co2_dia, a_co2_cocco, a_co2_calc, & - b_co2_phy, b_co2_dia, b_co2_cocco, b_co2_calc, & - c_co2_phy, c_co2_dia, c_co2_cocco, c_co2_calc, & - d_co2_phy, d_co2_dia, d_co2_cocco, d_co2_calc + Real(kind=8) :: c_co2_dia = 8.778e-01 ! [kg/mol] + Real(kind=8) :: c_co2_cocco = 3.912e-01 ! [kg/mol] + Real(kind=8) :: c_co2_phaeo = 2.255e-01 ! [kg/mol] + Real(kind=8) :: c_co2_calc = 7.079e-01 ! [kg/mol] + Real(kind=8) :: d_co2_phy = 1.023e+07 ! [kg/mol] + Real(kind=8) :: d_co2_dia = 2.640e+06 ! [kg/mol] + Real(kind=8) :: d_co2_cocco = 9.450e+06 ! [kg/mol] + Real(kind=8) :: d_co2_phaeo = 1.023e+07 ! [kg/mol] + Real(kind=8) :: d_co2_calc = 1.343e+07 ! [kg/mol] + namelist /paco2lim/ Cunits, a_co2_phy, a_co2_dia, a_co2_cocco, a_co2_phaeo, a_co2_calc, & + b_co2_phy, b_co2_dia, b_co2_cocco, b_co2_phaeo, b_co2_calc, & + c_co2_phy, c_co2_dia, c_co2_cocco, c_co2_phaeo, c_co2_calc, & + d_co2_phy, d_co2_dia, d_co2_cocco, d_co2_phaeo, d_co2_calc !!------------------------------------------------------------------------------ !! *** Iron *** Real(kind=8) :: Fe2N = 0.033d0 ! Fe2C * 6.625 (Fe2C = 0.005d0) Real(kind=8) :: Fe2N_benthos = 0.15d0 ! default was 0.14 Fe2C_benthos (=0.02125=0.68d0/32.d0) * 6.625 - will have to be tuned. [umol/m2/day] Real(kind=8) :: kScavFe = 0.07d0 Real(kind=8) :: dust_sol = 0.02d0 !Dissolution of Dust for bioavaliable - Real(kind=8) :: RiverFeConc = 100d0 ! mean DFe concentration in rivers + Real(kind=8) :: RiverFeConc = 100d0 ! mean DFe concentration in rivers namelist /pairon/ Fe2N, Fe2N_benthos, kScavFe, dust_sol, RiverFeConc !!------------------------------------------------------------------------------ !! *** Calcification *** @@ -489,16 +539,22 @@ Module REcoM_declarations Real(kind=8) :: tiny_N ! Min PhyN Real(kind=8) :: tiny_N_d ! Min DiaN Real(kind=8) :: tiny_N_c ! Min CocN ! NEW + Real(kind=8) :: tiny_N_p ! Min PhaN ! Phaeocystis Real(kind=8) :: tiny_C ! Min PhyC Real(kind=8) :: tiny_C_d ! Min DiaC Real(kind=8) :: tiny_C_c ! Min CocC ! NEW + Real(kind=8) :: tiny_C_p ! Min PhaC ! Phaeocystis Real(kind=8) :: tiny_Si ! Min DiaSi !!------------------------------------------------------------------------------ !! *** Temperature dependence of rates *** Real(kind=8) :: rTref ! [1/K] Reciproque value of reference temp for Arrhenius function Real(kind=8) :: rTloc ! [1/K] Reciproque of local ocean temp - Real(kind=8) :: arrFunc ! [] Temp dependence of rates - Real(kind=8) :: CoccoTFunc ! [] Temp dependence of coccolithophores + Real(kind=8) :: arrFunc ! [] Temp dependence of rates (also for Phaeocystis) + Real(kind=8) :: CoccoTFunc + Real(kind=8) :: Temp_diatoms ! [] Temp dependence of diatoms + Real(kind=8) :: Temp_phyto ! [] Temp dependence of small phyto + Real(kind=8) :: Temp_cocco ! [] Temp dependence of coccolithophores + Real(kind=8) :: Temp_phaeo ! [] Temp dependence of phaeocystis Real(kind=8) :: arrFuncZoo2 ! [] Temperature function for krill Real(kind=8) :: q10_mic ! 3Zoo Real(kind=8) :: q10_mic_res ! 3Zoo @@ -515,13 +571,15 @@ Module REcoM_declarations Real(kind=8) :: CoccoCO2 Real(kind=8) :: DiaCO2 Real(kind=8) :: PhyCO2 + Real(kind=8) :: PhaeoCO2 + !!------------------------------------------------------------------------------ !! *** Quotas *** - Real(kind=8) :: quota, quota_dia, quota_cocco ! [mmol N/mmol C] Quota between phytoplankton N and C (NEW changed term) - Real(kind=8) :: recipQuota, recipQuota_dia, recipQuota_cocco ! [mmol C/mmol N] Reciproque of 'quota' (NEW changed term) - Real(kind=8) :: Chl2C, Chl2C_dia, Chl2C_cocco ! [mg ChlA/mmol C] Quota between phytoplankton ChlA and C (NEW changed term) - Real(kind=8) :: Chl2C_plast, Chl2C_plast_dia, CHL2C_plast_cocco ! [mg ChlA/mmol C] needed for photodamage (NEW changed term) - Real(kind=8) :: Chl2N, Chl2N_dia, Chl2N_cocco ! [mg ChlA/mmol N] Quota between phytoplankton ChlA and N (NEW changed term) + Real(kind=8) :: quota, quota_dia, quota_cocco, quota_phaeo ! [mmol N/mmol C] Quota between phytoplankton N and C (NEW changed term) + Real(kind=8) :: recipQuota, recipQuota_dia, recipQuota_cocco, recipQuota_phaeo ! [mmol C/mmol N] Reciproque of 'quota' (NEW changed term) + Real(kind=8) :: Chl2C, Chl2C_dia, Chl2C_cocco, Chl2C_phaeo ! [mg ChlA/mmol C] Quota between phytoplankton ChlA and C (NEW changed term) + Real(kind=8) :: Chl2C_plast, Chl2C_plast_dia, CHL2C_plast_cocco, CHL2C_plast_phaeo ! [mg ChlA/mmol C] needed for photodamage (NEW changed term) + Real(kind=8) :: Chl2N, Chl2N_dia, Chl2N_cocco, Chl2N_phaeo ! [mg ChlA/mmol N] Quota between phytoplankton ChlA and N (NEW changed term) Real(kind=8) :: qSiC Real(kind=8) :: qSiN Real(kind=8) :: recipQZoo ! [mmol C/mmol N] Quota between heterotrophic C and N @@ -535,8 +593,8 @@ Module REcoM_declarations !! *** For limiter function *** Real(kind=8) :: qlimitFac, qlimitFacTmp ! Factor that regulates photosynthesis Real(kind=8),external :: recom_limiter ! Function calculating qlimitFac - Real(kind=8) :: FeLimitFac ! [Mumol/m3] Half sat constant for iron - Real(kind=8) :: pMax, pMax_dia, pMax_cocco ! [1/day] Maximum rate of C-specific photosynthesis + Real(kind=8) :: FeLimitFac ! [Mumol/m3] Half sat constant for iron + Real(kind=8) :: pMax, pMax_dia, pMax_cocco, pMax_phaeo ! [1/day] Maximum rate of C-specific photosynthesis !!------------------------------------------------------------------------------ !! *** Light *** Real(kind=8) :: kappar ! [1/m] Light attenuation coefficient modified by chla @@ -548,48 +606,59 @@ Module REcoM_declarations Real(kind=8) :: PARave ! [?] Average light in the control volumes !!------------------------------------------------------------------------------ !! *** Photosynthesis *** - Real(kind=8) :: Cphot, Cphot_dia, Cphot_cocco ! [1/day] C-specific rate of photosynthesis + Real(kind=8) :: Cphot, Cphot_dia, Cphot_cocco, Cphot_phaeo ! [1/day] C-specific rate of photosynthesis !!------------------------------------------------------------------------------ !! *** Assimilation *** - Real(kind=8) :: V_cm ! scaling factor for temperature dependent maximum of C-specific N-uptake - Real(kind=8) :: limitFacN,limitFacN_dia,limitFacN_cocco ! Factor that regulates N-assimilation. Calc from function recom_limiter + Real(kind=8) :: V_cm ! scaling factor for temperature dependent maximum of C-specific N-uptake + Real(kind=8) :: limitFacN,limitFacN_dia,limitFacN_cocco, limitFacN_phaeo ! Factor that regulates N-assimilation. Calc from function recom_limiter Real(kind=8) :: limitFacSi - Real(kind=8) :: N_assim, N_assim_dia, N_assim_Cocco ! [mmol N/(mmol C * day)] C specific N utilization rate + Real(kind=8) :: N_assim, N_assim_dia, N_assim_Cocco, N_assim_phaeo ! [mmol N/(mmol C * day)] C specific N utilization rate Real(kind=8) :: Si_assim !!------------------------------------------------------------------------------ !! *** Chlorophyll *** - Real(kind=8) :: ChlSynth, ChlSynth_dia, ChlSynth_cocco ! [mg CHL/ mmol N] CHL a synthesis regulation term - Real(kind=8) :: phyRespRate, phyRespRate_dia, phyRespRate_cocco ! [1/day] Phytoplankton respiration rate - Real(kind=8) :: KOchl, KOchl_dia, KOchl_cocco ! coefficient for damage to the photosynthetic apparatus + Real(kind=8) :: ChlSynth, ChlSynth_dia, ChlSynth_cocco, ChlSynth_phaeo ! [mg CHL/ mmol N] CHL a synthesis regulation term + Real(kind=8) :: phyRespRate, phyRespRate_dia, phyRespRate_cocco, phyRespRate_phaeo ! [1/day] Phytoplankton respiration rate + Real(kind=8) :: KOchl, KOchl_dia, KOchl_cocco, KOchl_phaeo ! coefficient for damage to the photosynthetic apparatus +!!------------------------------------------------------------------------------ +!! *** Vertical only Decomposition of phytoplankton growth components *** + Real(kind=8),allocatable,dimension(:) :: VTTemp_diatoms, VTTemp_phyto, VTTemp_cocco, VTTemp_phaeo ! Vertical 1D temperature effect on phytoplankton photosynthesis + Real(kind=8),allocatable,dimension(:) :: VTPhyCO2, VTDiaCO2, VTCoccoCO2, VTPhaeoCO2 ! CO2 effect + Real(kind=8),allocatable,dimension(:) :: VTqlimitFac_phyto, VTqlimitFac_diatoms, VTqlimitFac_cocco, VTqlimitFac_phaeo ! nutrient effect + Real(kind=8),allocatable,dimension(:) :: VTCphotLigLim_phyto, VTCphotLigLim_diatoms, VTCphotLigLim_cocco, VTCphotLigLim_phaeo ! light limitation + Real(kind=8),allocatable,dimension(:) :: VTCphot_phyto, VTCphot_diatoms, VTCphot_cocco, VTCphot_phaeo + Real(kind=8),allocatable,dimension(:) :: VTSi_assimDia + !!------------------------------------------------------------------------------ !! *** Iron chemistry *** Real(kind=8),external :: iron_chemistry, iron_chemistry_2ligands - Real(kind=8) :: logK1, logK2, Klig1, Klig2 + Real(kind=8) :: logK1, logK2, Klig1, Klig2 !!------------------------------------------------------------------------------ !! *** Zooplankton *** Real(kind=8) :: DiaNsq - Real(kind=8) :: varpzdia, fDiaN ! Part of Diatoms available for food - Real(kind=8) :: PhyNsq - Real(kind=8) :: varpzPhy, fPhyN ! Part of Nano available for food - Real(kind=8) :: CoccoNsq ! NEW - Real(kind=8) :: varpzCocco,fCoccoN ! NEW - Real(kind=8) :: MicZooNsq ! NEW 3Zoo - Real(kind=8) :: varpzMicZoo, fMicZooN ! NEW 3Zoo Part of microzooplankton available for food - Real(kind=8) :: food, foodsq ! [(mmol N)2/m6] - Real(kind=8) :: grazingFlux_phy, grazingFlux_Dia, grazingFlux_Cocco ! [mmol N / (m3 * day)] (NEW changed term) - Real(kind=8) :: grazingFlux_miczoo ! NEW 3Zoo + Real(kind=8) :: varpzdia, fDiaN ! Part of Diatoms available for food + Real(kind=8) :: PhyNsq + Real(kind=8) :: varpzPhy, fPhyN ! Part of Nano available for food + Real(kind=8) :: CoccoNsq + Real(kind=8) :: varpzCocco,fCoccoN + Real(kind=8) :: PhaeoNsq + Real(kind=8) :: varpzPhaeo,fPhaeoN + Real(kind=8) :: MicZooNsq ! NEW 3Zoo + Real(kind=8) :: varpzMicZoo, fMicZooN ! NEW 3Zoo Part of microzooplankton available for food + Real(kind=8) :: food, foodsq ! [(mmol N)2/m6] + Real(kind=8) :: grazingFlux_phy, grazingFlux_Dia, grazingFlux_Cocco, grazingFlux_Phaeo ! [mmol N / (m3 * day)] (NEW changed term) + Real(kind=8) :: grazingFlux_miczoo ! NEW 3Zoo Real(kind=8) :: grazingFlux - Real(kind=8) :: grazEff ! NEW 3Zoo + Real(kind=8) :: grazEff ! NEW 3Zoo Real(kind=8) :: HetRespFlux ! Zooplankton respiration Real(kind=8) :: HetLossFlux ! [(mmol N)2/(m6 * day)] Zooplankton mortality (quadratic loss) !!------------------------------------------------------------------------------ !! *** Second Zooplankton *** - Real(kind=8) :: DiaNsq2, PhyNsq2, CoccoNsq2, HetNsq ! NEW (changed term) - Real(kind=8) :: varpzDia2, fDiaN2, varpzPhy2, fPhyN2, varpzCocco2, fCoccoN2, varpzHet, fHetN ! Part of Diatoms available for food + Real(kind=8) :: DiaNsq2, PhyNsq2, CoccoNsq2, PhaeoNsq2, HetNsq ! NEW (changed term) + Real(kind=8) :: varpzDia2, fDiaN2, varpzPhy2, fPhyN2, varpzCocco2, fCoccoN2, varpzPhaeo2, fPhaeoN2, varpzHet, fHetN ! Part of Diatoms available for food Real(kind=8) :: MicZooNsq2 ! NEW Zoo3 Real(kind=8) :: varpzMicZoo2, fMicZooN2 ! NEW Zoo3 - Real(kind=8) :: food2, foodsq2 ! [(mmol N)2/m6] - Real(kind=8) :: grazingFlux_phy2, grazingFlux_Dia2, grazingFlux_Cocco2, grazingFlux_het2 ! [mmol N / (m3 * day) (NEW changed term) + Real(kind=8) :: food2, foodsq2 ! [(mmol N)2/m6] + Real(kind=8) :: grazingFlux_phy2, grazingFlux_Dia2, grazingFlux_Cocco2, grazingFlux_Phaeo2, grazingFlux_het2 ! [mmol N / (m3 * day) (NEW changed term) Real(kind=8) :: grazingFlux_miczoo2 ! NEW Zoo3 Real(kind=8) :: grazingFlux2 Real(kind=8) :: Zoo2RespFlux ! Zooplankton respiration @@ -615,8 +684,10 @@ Module REcoM_declarations Real(kind=8) :: varpzPhy3, fPhyN3 ! Part of small phytoplankton available for food Real(kind=8) :: CoccoNsq3 Real(kind=8) :: varpzCocco3, fCoccoN3 ! Part of coccolithophores available for food + Real(kind=8) :: PhaeoNsq3 + Real(kind=8) :: varpzPhaeo3, fPhaeoN3 ! Part of phaeocystis available for food Real(kind=8) :: food3, foodsq3 ! [(mmol N)2/m6] - Real(kind=8) :: grazingFlux_phy3, grazingFlux_Dia3, grazingFlux_Cocco3 ! [mmol N / (m3 * day)] + Real(kind=8) :: grazingFlux_phy3, grazingFlux_Dia3, grazingFlux_Cocco3, grazingFlux_Phaeo3 ! [mmol N / (m3 * day)] Real(kind=8) :: grazingFlux3 Real(kind=8) :: MicZooRespFlux ! Zooplankton respiration Real(kind=8) :: MicZooLossFlux ! [(mmol N)2/(m6 * day)] Zooplankton mortality (quadratic loss) @@ -643,15 +714,16 @@ Module REcoM_declarations Real(kind=8) :: locNPPn, locGPPn, locNNAn, locChldegn Real(kind=8) :: locNPPd, locGPPd, locNNAd, locChldegd Real(kind=8) :: locNPPc, locGPPc, locNNAc, locChldegc + Real(kind=8) :: locNPPp, locGPPp, locNNAp, locChldegp ! Phaeocystis Real(kind=8),allocatable,dimension(:) :: vertNPPn, vertGPPn, vertNNAn, vertChldegn Real(kind=8),allocatable,dimension(:) :: vertNPPd, vertGPPd, vertNNAd, vertChldegd Real(kind=8),allocatable,dimension(:) :: vertNPPc, vertGPPc, vertNNAc, vertChldegc - Real(kind=8),allocatable,dimension(:) :: vertgrazmeso_tot, vertgrazmeso_n, vertgrazmeso_d, vertgrazmeso_c + Real(kind=8),allocatable,dimension(:) :: vertNPPp, vertGPPp, vertNNAp, vertChldegp ! Phaeocystis Real(kind=8),allocatable,dimension(:) :: vertrespmeso, vertrespmacro, vertrespmicro Real(kind=8),allocatable,dimension(:) :: vertcalcdiss, vertcalcif - Real(kind=8),allocatable,dimension(:) :: vertaggn, vertaggd, vertaggc - Real(kind=8),allocatable,dimension(:) :: vertdocexn, vertdocexd, vertdocexc - Real(kind=8),allocatable,dimension(:) :: vertrespn, vertrespd, vertrespc + Real(kind=8),allocatable,dimension(:) :: vertaggn, vertaggd, vertaggc, vertaggp + Real(kind=8),allocatable,dimension(:) :: vertdocexn, vertdocexd, vertdocexc, vertdocexp + Real(kind=8),allocatable,dimension(:) :: vertrespn, vertrespd, vertrespc, vertrespp !!------------------------------------------------------------------------------ !! *** Benthos *** Real(kind=8),allocatable,dimension(:) :: decayBenthos ! [1/day] Decay rate of detritus in the benthic layer @@ -659,11 +731,13 @@ Module REcoM_declarations Real(kind=8),allocatable,dimension(:) :: wFluxPhy ! [mmol/(m2 * day)] Flux of N,C, calc and chl through sinking of phytoplankton Real(kind=8),allocatable,dimension(:) :: wFluxDia ! [mmol/(m2 * day)] Flux of N,C, Si and chl through sinking of diatoms Real(kind=8),allocatable,dimension(:) :: wFluxCocco ! NEW [mmol/(m2 * day)] Flux of N,C, calc and chl through sinking of coccos + Real(kind=8),allocatable,dimension(:) :: wFluxPhaeo ! NEW [mmol/(m2 * day)] Flux of N,C, calc and chl through sinking of Phaeocystis Real(kind=8) :: Vben_det ! [m/day] speed of sinking into benthos from water column Real(kind=8) :: Vben_det_seczoo !second zooplankton sinking benthos Real(kind=8) :: Vben_phy Real(kind=8) :: Vben_dia Real(kind=8) :: Vben_coc + Real(kind=8) :: Vben_pha ! Phaeocystis Real(kind=8) :: Ironflux ! [umol Fe/(m2*day)] Flux of Fe from sediment to water !_______________________________________________________________________________ ! Arrays added for RECOM implementation: @@ -686,7 +760,7 @@ end module REcoM_declarations Module REcoM_GloVar implicit none save - + Real(kind=8),allocatable,dimension(:,:) :: Benthos ! 4 types of benthos-tracers with size [4 n2d] Real(kind=8),allocatable,dimension(:,:,:) :: Benthos_tr ! kh 25.03.22 buffer sums per tracer index to avoid non bit identical results regarding global sums when running the tracer loop in parallel @@ -725,7 +799,8 @@ Module REcoM_GloVar Real(kind=8),allocatable,dimension(:,:) :: GlowFluxDet ! Real(kind=8),allocatable,dimension(:,:) :: GlowFluxPhy ! Real(kind=8),allocatable,dimension(:,:) :: GlowFluxDia ! - Real(kind=8),allocatable,dimension(:,:) :: GlowFluxCocco ! + Real(kind=8),allocatable,dimension(:,:) :: GlowFluxCocco ! + Real(kind=8),allocatable,dimension(:,:) :: GlowFluxPhaeo ! Real(kind=8),allocatable,dimension(:,:) :: diags2D ! Diagnostics in 2D [8 n2d] Real(kind=8),allocatable,dimension(:) :: NPPn @@ -740,6 +815,10 @@ Module REcoM_GloVar Real(kind=8),allocatable,dimension(:) :: GPPc Real(kind=8),allocatable,dimension(:) :: NNAc Real(kind=8),allocatable,dimension(:) :: Chldegc + Real(kind=8),allocatable,dimension(:) :: NPPp ! Phaeocystis + Real(kind=8),allocatable,dimension(:) :: GPPp + Real(kind=8),allocatable,dimension(:) :: NNAp + Real(kind=8),allocatable,dimension(:) :: Chldegp Real(kind=8),allocatable,dimension(:,:) :: grazmeso_tot Real(kind=8),allocatable,dimension(:,:) :: grazmeso_n Real(kind=8),allocatable,dimension(:,:) :: grazmeso_d @@ -752,15 +831,40 @@ Module REcoM_GloVar Real(kind=8),allocatable,dimension(:,:) :: aggn Real(kind=8),allocatable,dimension(:,:) :: aggd Real(kind=8),allocatable,dimension(:,:) :: aggc + Real(kind=8),allocatable,dimension(:,:) :: aggp ! Phaeocystis Real(kind=8),allocatable,dimension(:,:) :: docexn Real(kind=8),allocatable,dimension(:,:) :: docexd Real(kind=8),allocatable,dimension(:,:) :: docexc + Real(kind=8),allocatable,dimension(:,:) :: docexp ! Phaeocystis Real(kind=8),allocatable,dimension(:,:) :: respn Real(kind=8),allocatable,dimension(:,:) :: respd Real(kind=8),allocatable,dimension(:,:) :: respc + Real(kind=8),allocatable,dimension(:,:) :: respp ! Phaeocystis Real(kind=8),allocatable,dimension(:,:) :: NPPn3D Real(kind=8),allocatable,dimension(:,:) :: NPPd3D Real(kind=8),allocatable,dimension(:,:) :: NPPc3D + Real(kind=8),allocatable,dimension(:,:) :: NPPp3D ! Phaeocystis + Real(kind=8),allocatable,dimension(:,:) :: TTemp_diatoms ! my new variables to track + Real(kind=8),allocatable,dimension(:,:) :: TTemp_phyto ! new Temperature effect + Real(kind=8),allocatable,dimension(:,:) :: TTemp_cocco ! new + Real(kind=8),allocatable,dimension(:,:) :: TTemp_phaeo ! new + Real(kind=8),allocatable,dimension(:,:) :: TPhyCO2 ! new CO2 effect + Real(kind=8),allocatable,dimension(:,:) :: TDiaCO2 + Real(kind=8),allocatable,dimension(:,:) :: TCoccoCO2 + Real(kind=8),allocatable,dimension(:,:) :: TPhaeoCO2 + Real(kind=8),allocatable,dimension(:,:) :: TqlimitFac_phyto ! new nutrient limitation + Real(kind=8),allocatable,dimension(:,:) :: TqlimitFac_diatoms + Real(kind=8),allocatable,dimension(:,:) :: TqlimitFac_cocco + Real(kind=8),allocatable,dimension(:,:) :: TqlimitFac_phaeo + Real(kind=8),allocatable,dimension(:,:) :: TCphotLigLim_phyto ! new light limitation + Real(kind=8),allocatable,dimension(:,:) :: TCphot_phyto ! new + Real(kind=8),allocatable,dimension(:,:) :: TCphotLigLim_diatoms ! new light limitation + Real(kind=8),allocatable,dimension(:,:) :: TCphot_diatoms + Real(kind=8),allocatable,dimension(:,:) :: TCphotLigLim_cocco ! new light limitation + Real(kind=8),allocatable,dimension(:,:) :: TCphot_cocco + Real(kind=8),allocatable,dimension(:,:) :: TCphotLigLim_phaeo ! new light limitation + Real(kind=8),allocatable,dimension(:,:) :: TCphot_phaeo + Real(kind=8),allocatable,dimension(:,:) :: TSi_assimDia ! tracking the assimilation of Si by Diatoms Real(kind=8),allocatable,dimension(:) :: DenitBen ! Benthic denitrification Field in 2D [n2d 1] @@ -776,7 +880,7 @@ Module REcoM_GloVar Real(kind=8),allocatable,dimension(:,:) :: lb_flux ! Yearly burial from medusa: [n2d 5] or [n2d 9] with ciso_14 ! atmospheric box model: - real(kind=8),allocatable,dimension(:) :: x_co2atm ! atmospheric CO2 mixing ratio (mole fraction) + Real(kind=8),allocatable,dimension(:) :: x_co2atm ! atmospheric CO2 mixing ratio (mole fraction) Real(kind=8), allocatable,dimension(:) :: Alk_surf ! Surface alkalinity field used for restoring Real(kind=8), allocatable,dimension(:) :: relax_alk @@ -865,7 +969,7 @@ Module REcoM_locVar Real(kind=8) :: PICPOCN ! (to make calcification dependent on N-limitation) Real(kind=8) :: calc_prod_final ! (added to make the calcification dependent on nutrients (N, Fe), after Krumhardt et al. 2017/2019) Integer :: currentCO2year - + end module REcoM_LocVar !=============================================================================== ! Specific declarations related to carbon isotope simulations diff --git a/src/int_recom/recom_sinking.F90 b/src/int_recom/recom_sinking.F90 index 0971e5bd0..2b0c721f3 100644 --- a/src/int_recom/recom_sinking.F90 +++ b/src/int_recom/recom_sinking.F90 @@ -141,6 +141,18 @@ subroutine ver_sinking_recom_benthos(tr_num, tracers, partit, mesh) tracers%data(tr_num)%ID==1013 .or. & !idian tracers%data(tr_num)%ID==1025 ) then !idetz2n Benthos(n,1)= Benthos(n,1) + add_benthos_2d(n) ![mmol] + + if (use_MEDUSA) then +! kh 25.03.22 buffer sums per tracer index to avoid non bit identical results regarding global sums when running the tracer loop in parallel + SinkFlx_tr(n,1,tr_num) = SinkFlx_tr(n,1,tr_num) + add_benthos_2d(n) / area(1,n)/dt ![mmol/m2] + ! now SinkFlx hat the unit mmol/time step + ! but mmol/m2/time is needed for MEDUSA: thus /area + endif + if ((.not.use_MEDUSA).or.(sedflx_num.eq.0)) then +! kh 25.03.22 buffer sums per tracer index to avoid non bit identical results regarding global sums when running the tracer loop in parallel + Benthos_tr(n,1,tr_num)= Benthos_tr(n,1,tr_num) + add_benthos_2d(n) ![mmol] + endif + endif !! * Particulate Organic Carbon * @@ -149,6 +161,16 @@ subroutine ver_sinking_recom_benthos(tr_num, tracers, partit, mesh) tracers%data(tr_num)%ID==1014 .or. & !idiac tracers%data(tr_num)%ID==1026 ) then !idetz2c Benthos(n,2)= Benthos(n,2) + add_benthos_2d(n) + + if (use_MEDUSA) then +! kh 25.03.22 buffer sums per tracer index to avoid non bit identical results regarding global sums when running the tracer loop in parallel + SinkFlx_tr(n,2,tr_num) = SinkFlx_tr(n,2,tr_num) + add_benthos_2d(n) / area(1,n)/dt + endif + if ((.not.use_MEDUSA).or.(sedflx_num.eq.0)) then +! kh 25.03.22 buffer sums per tracer index to avoid non bit identical results regarding global sums when running the tracer loop in parallel + Benthos_tr(n,2,tr_num)= Benthos_tr(n,2,tr_num) + add_benthos_2d(n) + endif + endif !! *Particulate Organic Silicon * @@ -156,6 +178,16 @@ subroutine ver_sinking_recom_benthos(tr_num, tracers, partit, mesh) tracers%data(tr_num)%ID==1017 .or. & !idetsi tracers%data(tr_num)%ID==1027 ) then !idetz2si Benthos(n,3)= Benthos(n,3) + add_benthos_2d(n) + + if (use_MEDUSA) then +! kh 25.03.22 buffer sums per tracer index to avoid non bit identical results regarding global sums when running the tracer loop in parallel + SinkFlx_tr(n,3,tr_num) = SinkFlx_tr(n,3,tr_num) + add_benthos_2d(n) / area(1,n)/dt + endif + if ((.not.use_MEDUSA).or.(sedflx_num.eq.0)) then +! kh 25.03.22 buffer sums per tracer index to avoid non bit identical results regarding global sums when running the tracer loop in parallel + Benthos_tr(n,3,tr_num)= Benthos_tr(n,3,tr_num) + add_benthos_2d(n) + endif + endif !! * Cal * @@ -163,9 +195,96 @@ subroutine ver_sinking_recom_benthos(tr_num, tracers, partit, mesh) tracers%data(tr_num)%ID==1021 .or. & !idetcal tracers%data(tr_num)%ID==1028 ) then !idetz2cal Benthos(n,4)= Benthos(n,4) + add_benthos_2d(n) + + if (use_MEDUSA) then +! kh 25.03.22 buffer sums per tracer index to avoid non bit identical results regarding global sums when running the tracer loop in parallel + SinkFlx_tr(n,4,tr_num) = SinkFlx_tr(n,4,tr_num) + add_benthos_2d(n) / area(1,n)/dt + endif + if ((.not.use_MEDUSA).or.(sedflx_num.eq.0)) then +! kh 25.03.22 buffer sums per tracer index to avoid non bit identical results regarding global sums when running the tracer loop in parallel + Benthos_tr(n,4,tr_num)= Benthos_tr(n,4,tr_num) + add_benthos_2d(n) + endif + + endif + + ! flux of 13C into the sediment + if (ciso) then + if( tracers%data(tr_num)%ID==1305 .or. & !iphyc_13 + tracers%data(tr_num)%ID==1308 .or. & !idetc_13 + tracers%data(tr_num)%ID==1314 ) then !idiac_14 + + if (use_MEDUSA) then +! kh 25.03.22 buffer sums per tracer index to avoid non bit identical results regarding global sums when running the tracer loop in parallel + SinkFlx_tr(n,5,tr_num) = SinkFlx_tr(n,5,tr_num) + add_benthos_2d(n) / area(1,n)/dt + endif + if ((.not.use_MEDUSA).or.(sedflx_num.eq.0)) then +! kh 25.03.22 buffer sums per tracer index to avoid non bit identical results regarding global sums when running the tracer loop in parallel + Benthos_tr(n,5,tr_num)= Benthos_tr(n,5,tr_num) + add_benthos_2d(n) + endif + + endif + + if( tracers%data(tr_num)%ID==1320 .or. & !iphycal + tracers%data(tr_num)%ID==1321 ) then !idetcal + + if (use_MEDUSA) then +! kh 25.03.22 buffer sums per tracer index to avoid non bit identical results regarding global sums when running the tracer loop in parallel + SinkFlx_tr(n,6,tr_num) = SinkFlx_tr(n,6,tr_num) + add_benthos_2d(n) / area(1,n)/dt + endif + if ((.not.use_MEDUSA).or.(sedflx_num.eq.0)) then +! kh 25.03.22 buffer sums per tracer index to avoid non bit identical results regarding global sums when running the tracer loop in parallel + Benthos_tr(n,6,tr_num)= Benthos_tr(n,6,tr_num) + add_benthos_2d(n) + endif + + endif + endif + + ! flux of 14C into the sediment + if (ciso .and. ciso_organic_14) then + if( tracers%data(tr_num)%ID==1405 .or. & !iphyc_13 + tracers%data(tr_num)%ID==1408 .or. & !idetc_13 + tracers%data(tr_num)%ID==1414 ) then !idiac_14 + + if (use_MEDUSA) then +! kh 25.03.22 buffer sums per tracer index to avoid non bit identical results regarding global sums when running the tracer loop in parallel + SinkFlx_tr(n,7,tr_num) = SinkFlx_tr(n,7,tr_num) + add_benthos_2d(n) / area(1,n)/dt + endif + if ((.not.use_MEDUSA).or.(sedflx_num.eq.0)) then +! kh 25.03.22 buffer sums per tracer index to avoid non bit identical results regarding global sums when running the tracer loop in parallel + Benthos_tr(n,7,tr_num)= Benthos_tr(n,7,tr_num) + add_benthos_2d(n) + endif + + endif + + if( tracers%data(tr_num)%ID==1420 .or. & !iphycal + tracers%data(tr_num)%ID==1421 ) then !idetcal + if (use_MEDUSA) then +! kh 25.03.22 buffer sums per tracer index to avoid non bit identical results regarding global sums when running the tracer loop in parallel + SinkFlx_tr(n,8,tr_num) = SinkFlx_tr(n,8,tr_num) + add_benthos_2d(n) / area(1,n)/dt + endif + if ((.not.use_MEDUSA).or.(sedflx_num.eq.0)) then +! kh 25.03.22 buffer sums per tracer index to avoid non bit identical results regarding global sums when running the tracer loop in parallel + Benthos_tr(n,8,tr_num)= Benthos_tr(n,8,tr_num) + add_benthos_2d(n) + endif + endif + + endif + end do + + if(use_MEDUSA) then + do n=1, bottflx_num +! SinkFlx(:,n) = Sinkflx(:,n)/dt +! kh 25.03.22 buffer sums per tracer index to avoid non bit identical results regarding global sums when running the tracer loop in parallel + call exchange_nod(SinkFlx_tr(:,n,tr_num), partit) + end do + end if ! use_MEDUSA + do n=1, benthos_num +! kh 25.03.22 buffer sums per tracer index to avoid non bit identical results regarding global sums when running the tracer loop in parallel + call exchange_nod(Benthos_tr(:,n,tr_num), partit) + call exchange_nod(Benthos(:,n), partit) end do @@ -223,6 +342,43 @@ subroutine diff_ver_recom_expl(tr_num, tracers, partit, mesh) bottom_flux = 0._WP id = tracers%data(tr_num)%ID +#if defined(__recom) +if (use_MEDUSA .and. (sedflx_num .ne. 0)) then + !CV update: the calculation later has been changed by Ozgur in such + !a way that now the variable bottom_flux is in (mol/time) units, + !rather than a flux in (mol/time/area). I therefore multiply the + !Medusa fluxes by the area to get the same unit. + + SELECT CASE (id) + CASE (1001) + bottom_flux = GloSed(:,1) * area(1,:) ! DIN + CASE (1002) + bottom_flux = GloSed(:,2) * area(1,:) ! DIC + CASE (1003) + bottom_flux = GloSed(:,3) * area(1,:) ! Alk + CASE (1018) + bottom_flux = GloSed(:,4) * area(1,:) ! Si + CASE (1019) + bottom_flux = GloSed(:,1) * Fe2N_benthos * area(1,:) + CASE (1022) + bottom_flux = GloSed(:,5) * area(1,:) ! Oxy + CASE (1302) + if (ciso) then + bottom_flux = GloSed(:,6) * area(1,:) ! DIC_13 and Calc: DIC_13 + end if + CASE (1402) + if (ciso) then + bottom_flux = GloSed(:,7) * area(1,:) ! DIC_14 and Calc: DIC_14 + end if + CASE DEFAULT + if (partit%mype==0) then + write(*,*) 'check specified in boundary conditions' + write(*,*) 'the model will stop!' + end if + call par_ex(partit%MPI_COMM_FESOM, partit%mype) + stop + END SELECT +else SELECT CASE (id) CASE (1001) bottom_flux = GlodecayBenthos(:,1) !*** DIN [mmolN/m^2/s] *** @@ -236,6 +392,14 @@ subroutine diff_ver_recom_expl(tr_num, tracers, partit, mesh) bottom_flux = GlodecayBenthos(:,1) * Fe2N_benthos !*** DFe *** CASE (1022) bottom_flux = -GlodecayBenthos(:,2) * redO2C !*** O2 *** + CASE (1302) + if (ciso) then + bottom_flux = GlodecayBenthos(:,5) + GlodecayBenthos(:,6) !*** DIC_13 and Calc: DIC_13 *** + end if + CASE (1402) + if (ciso) then + bottom_flux = GlodecayBenthos(:,7) + GlodecayBenthos(:,8) !*** DIC_14 and Calc: DIC_14 *** + end if CASE DEFAULT if (partit%mype==0) then write(*,*) 'check specified in boundary conditions' @@ -244,6 +408,8 @@ subroutine diff_ver_recom_expl(tr_num, tracers, partit, mesh) call par_ex(partit%MPI_COMM_FESOM, partit%mype) stop END SELECT +endif ! (use_MEDUSA .and. (sedflux_num .gt. 0)) +#endif do n=1, myDim_nod2D @@ -309,7 +475,7 @@ subroutine ver_sinking_recom(tr_num, tracers, partit, mesh) real(kind=8) :: Rjp,Rj,Rjm real(kind=8) :: cfl, d0, d1, thetaP, thetaM, psiP, psiM - real(kind=8) :: onesixth = 1.d0/6.d0 + real(kind=8) :: onesixth = 1.d0/6.d0 real(kind=8) :: dt_sink, c1, c2 real(kind=8) :: Vsink, tv real(kind=8),dimension(mesh%nl) :: Wvel_flux @@ -360,6 +526,13 @@ subroutine ver_sinking_recom(tr_num, tracers, partit, mesh) tracers%data(tr_num)%ID == 1031 ) then !icchl Vsink = VCocco + + elseif(tracers%data(tr_num)%ID == 1032 .or. & !iphan + tracers%data(tr_num)%ID == 1033 .or. & !iphac + tracers%data(tr_num)%ID == 1034 ) then !iphachl + + Vsink = VPhaeo + #endif elseif(tracers%data(tr_num)%ID == 1020) then !iphycal @@ -438,6 +611,13 @@ subroutine ver_sinking_recom(tr_num, tracers, partit, mesh) endif #endif + + if (tracers%data(tr_num)%ID == 1021) Sinkvel1_tr(nz,n,tr_num) = Wvel_flux(nz) !-1.0d0/SecondsPerDay !idetcal +#if defined (__3Zoo2Det) + if (tracers%data(tr_num)%ID == 1028) Sinkvel2_tr(nz,n,tr_num) = Wvel_flux(nz) !idetz2calc +#endif + + end do dt_sink = dt @@ -477,7 +657,7 @@ subroutine ver_sinking_recom(tr_num, tracers, partit, mesh) (1.d0-cfl)/(1.d-20-cfl)*thetaM)) tv= (0.5 * wPs * (trarr(nz,n) + psiM * Rj)+ & - 0.5 * wM * (trarr(max(nzmin,nz-1),n) + psiP * Rj)) + 0.5 * wM * (trarr(max(nzmin,nz-1),n) + psiP * Rj)) vd_flux(nz)= - tv*area(nz,n) end do end if ! 3rd Order DST Sceheme with flux limiting diff --git a/src/int_recom/recom_sms.F90 b/src/int_recom/recom_sms.F90 index 044d59c1e..67654a495 100644 --- a/src/int_recom/recom_sms.F90 +++ b/src/int_recom/recom_sms.F90 @@ -41,7 +41,7 @@ subroutine REcoM_sms(n,Nn,state,thick,recipthick,SurfSR,sms,Temp, Sali_depth & integer, intent(in) :: Nn !< Total number of nodes in the vertical real(kind=8),dimension(mesh%nl-1,bgc_num),intent(inout) :: state !< ChlA conc in phytoplankton [mg/m3] - !! should be in instead of inout + !! should be in instead of inout real(kind=8),dimension(mesh%nl-1) :: thick !< [m] Vertical distance between two nodes = Thickness real(kind=8),dimension(mesh%nl-1) :: recipthick !< [1/m] reciprocal of thick @@ -107,6 +107,9 @@ subroutine REcoM_sms(n,Nn,state,thick,recipthick,SurfSR,sms,Temp, Sali_depth & CoccoN, & CoccoC, & CoccoChl,& + PhaeoN, & + PhaeoC, & + PhaeoChl,& #endif Si, & Fe, & @@ -143,6 +146,8 @@ subroutine REcoM_sms(n,Nn,state,thick,recipthick,SurfSR,sms,Temp, Sali_depth & #if defined (__coccos) tiny_N_c = tiny_chl/chl2N_max_c tiny_C_c = tiny_N_c/NCmax_c + tiny_N_p = tiny_chl/chl2N_max_p + tiny_C_p = tiny_N_p/NCmax_p #endif recip_res_het = 1.d0/res_het !< res_het = 0.01d0 [1/day] Respiration by heterotrophs and mortality (loss to detritus) @@ -162,7 +167,7 @@ subroutine REcoM_sms(n,Nn,state,thick,recipthick,SurfSR,sms,Temp, Sali_depth & !Main time loop starts do step = one,biostep - kdzUpper = 0.d0 !< Upper light attenuation of top cell is set to zero + kdzUpper = 0.d0 !< Upper light attenuation of top cell is set to zero if (any(abs(sms(:,:)) <= tiny)) sms(:,:) = zero ! tiny = 2.23D-16 @@ -173,16 +178,16 @@ subroutine REcoM_sms(n,Nn,state,thick,recipthick,SurfSR,sms,Temp, Sali_depth & ! Nn=nlevels_nod2D(n)-1 !nzmax ! nzmin = ulevels_nod2D(row) ! nzmax = nlevels_nod2D(row) - DIN = max(tiny,state(k,idin) + sms(k,idin )) !< Avoids division by zero - DIC = max(tiny,state(k,idic) + sms(k,idic )) !! and updates Conc between - ALK = max(tiny,state(k,ialk) + sms(k,ialk )) !! local steps in REcoM when + DIN = max(tiny,state(k,idin) + sms(k,idin )) !< Avoids division by zero + DIC = max(tiny,state(k,idic) + sms(k,idic )) !! and updates Conc between + ALK = max(tiny,state(k,ialk) + sms(k,ialk )) !! local steps in REcoM when PhyN = max(tiny_N,state(k,iphyn) + sms(k,iphyn )) !! biostep > 1 - PhyC = max(tiny_C,state(k,iphyc) + sms(k,iphyc )) + PhyC = max(tiny_C,state(k,iphyc) + sms(k,iphyc )) PhyChl = max(tiny_chl,state(k,ipchl) + sms(k,ipchl )) - DetN = max(tiny,state(k,idetn) + sms(k,idetn )) - DetC = max(tiny,state(k,idetc) + sms(k,idetc )) - HetN = max(tiny,state(k,ihetn) + sms(k,ihetn )) - HetC = max(tiny,state(k,ihetc) + sms(k,ihetc )) + DetN = max(tiny,state(k,idetn) + sms(k,idetn )) + DetC = max(tiny,state(k,idetc) + sms(k,idetc )) + HetN = max(tiny,state(k,ihetn) + sms(k,ihetn )) + HetC = max(tiny,state(k,ihetc) + sms(k,ihetc )) #if defined (__3Zoo2Det) Zoo2N = max(tiny,state(k,izoo2n) + sms(k,izoo2n)) Zoo2C = max(tiny,state(k,izoo2c) + sms(k,izoo2c)) @@ -194,19 +199,22 @@ subroutine REcoM_sms(n,Nn,state,thick,recipthick,SurfSR,sms,Temp, Sali_depth & MicZooC = max(tiny,state(k,imiczooc) + sms(k,imiczooc)) #endif DON = max(tiny,state(k,idon) + sms(k,idon )) - EOC = max(tiny,state(k,idoc) + sms(k,idoc )) + EOC = max(tiny,state(k,idoc) + sms(k,idoc )) DiaN = max(tiny_N_d,state(k,idian) + sms(k,idian )) DiaC = max(tiny_C_d,state(k,idiac) + sms(k,idiac )) DiaChl = max(tiny_chl,state(k,idchl) + sms(k,idchl )) DiaSi = max(tiny_si,state(k,idiasi) + sms(k,idiasi)) - DetSi = max(tiny,state(k,idetsi) + sms(k,idetsi)) - Si = max(tiny,state(k,isi) + sms(k,isi )) + DetSi = max(tiny,state(k,idetsi) + sms(k,idetsi)) + Si = max(tiny,state(k,isi) + sms(k,isi )) #if defined (__coccos) CoccoN = max(tiny_N_c,state(k,icocn) + sms(k,icocn )) CoccoC = max(tiny_C_c,state(k,icocc) + sms(k,icocc )) CoccoChl = max(tiny_chl,state(k,icchl) + sms(k,icchl )) + PhaeoN = max(tiny_N_p,state(k,iphan) + sms(k,iphan )) ! Phaeocystis + PhaeoC = max(tiny_C_p,state(k,iphac) + sms(k,iphac )) + PhaeoChl = max(tiny_chl,state(k,iphachl) + sms(k,iphachl )) #endif - Fe = max(tiny,state(k,ife) + sms(k,ife )) + Fe = max(tiny,state(k,ife) + sms(k,ife )) O2 = max(tiny,state(k,ioxy) + sms(k,ioxy)) FreeFe = zero @@ -242,12 +250,19 @@ subroutine REcoM_sms(n,Nn,state,thick,recipthick,SurfSR,sms,Temp, Sali_depth & qSiC = DiaSi / DiaC qSiN = DiaSi / DiaN -#if defined (__coccos) +#if defined (__coccos) + ! *** Coccolithophores quota_cocco = CoccoN / CoccoC recipQuota_cocco = real(one)/quota_cocco Chl2C_cocco = CoccoChl / CoccoC Chl2N_cocco = CoccoChl / CoccoN CHL2C_plast_cocco = Chl2C_cocco * (quota_cocco/(quota_cocco - NCmin_c)) + ! *** Phaeocystis + quota_phaeo = PhaeoN / PhaeoC + recipQuota_phaeo = real(one)/quota_phaeo + Chl2C_phaeo = PhaeoChl / PhaeoC + Chl2N_phaeo = PhaeoChl / PhaeoN + CHL2C_plast_phaeo = Chl2C_phaeo * (quota_phaeo/(quota_phaeo - NCmin_p)) #endif recipQZoo = HetC / HetN recip_hetN_plus = 1.d0 / (HetN + tiny_het) ! MB's addition for more stable zoo respiration @@ -258,6 +273,50 @@ subroutine REcoM_sms(n,Nn,state,thick,recipthick,SurfSR,sms,Temp, Sali_depth & if (Grazing_detritus) recipDet2 = DetZ2C / DetZ2N #endif + if (ciso) then +!< additional variables are declared in module REcoM_ciso + DIC_13 = max(tiny,state(k,idic_13) + sms(k,idic_13 )) + PhyC_13 = max(tiny_C,state(k,iphyc_13) + sms(k,iphyc_13 )) + DetC_13 = max(tiny,state(k,idetc_13) + sms(k,idetc_13 )) + HetC_13 = max(tiny,state(k,ihetc_13) + sms(k,ihetc_13 )) + EOC_13 = max(tiny,state(k,idoc_13) + sms(k,idoc_13 )) + DiaC_13 = max(tiny_C,state(k,idiac_13) + sms(k,idiac_13 )) + PhyCalc_13 = max(tiny,state(k,iphycal_13) + sms(k,iphycal_13)) + DetCalc_13 = max(tiny,state(k,idetcal_13) + sms(k,idetcal_13)) + + calc_diss_13 = alpha_dcal_13 * calc_diss + + quota_13 = PhyN / PhyC_13 + recipQuota_13 = real(one) / quota_13 + + quota_dia_13 = DiaN / DiaC_13 + recipQuota_dia_13 = real(one) / quota_dia_13 + + recipQZoo_13 = HetC_13 / HetN + + if (ciso_14) then + DIC_14 = max(tiny,state(k,idic_14) + sms(k,idic_14 )) + if (ciso_organic_14) then + PhyC_14 = max(tiny_C,state(k,iphyc_14) + sms(k,iphyc_14 )) + DetC_14 = max(tiny,state(k,idetc_14) + sms(k,idetc_14 )) + HetC_14 = max(tiny,state(k,ihetc_14) + sms(k,ihetc_14 )) + EOC_14 = max(tiny,state(k,idoc_14) + sms(k,idoc_14 )) + DiaC_14 = max(tiny_C,state(k,idiac_14) + sms(k,idiac_14 )) + PhyCalc_14 = max(tiny,state(k,iphycal_14) + sms(k,iphycal_14)) + DetCalc_14 = max(tiny,state(k,idetcal_14) + sms(k,idetcal_14)) + + calc_diss_14 = alpha_dcal_14 * calc_diss + + quota_14 = PhyN / PhyC_14 + recipQuota_14 = real(one) / quota_14 + + quota_dia_14 = DiaN / DiaC_14 + recipQuota_dia_14 = real(one) / quota_dia_14 + recipQZoo_14 = HetC_14 / HetN + end if ! ciso_organic_14 + end if ! ciso_14 + end if ! ciso + !------------------------------------------------------------------------------- !> Temperature dependence of rates !------------------------------------------------------------------------------- @@ -271,8 +330,40 @@ subroutine REcoM_sms(n,Nn,state,thick,recipthick,SurfSR,sms,Temp, Sali_depth & rTloc = real(one)/(Temp(k) + C2K) arrFunc = exp(-Ae * ( rTloc - rTref)) -#if defined (__coccos) - CoccoTFunc = max(0.1419d0 * Temp(k)**0.8151d0,tiny) ! Function from Fielding 2013; is based on observational GR, but range fits best to ours + + +! The following part defines the new temperature functions with are ONLY used in the 4P version with Coccos and Phaeo (new temp +! functions in 2p version would need to be tuned first) + +! #if defined (__coccos) ! (old Cocco temperature function) +! CoccoTFunc = max(0.1419d0 * Temp(k)**0.8151d0,tiny) ! Function from Fielding 2013; is based on observational GR, but range fits best to ours +! #endif + +!< New phytoplankton temperature functions +#if defined (__coccos) + + ! Small Phytoplankton: + Temp_phyto = exp(ord_phy + expon_phy * Temp(k)) ! NEW MODIFIED + VTTemp_phyto(k) = Temp_phyto + + ! Diatoms: + Temp_diatoms = exp(ord_d + expon_d * Temp(k)) ! NEW MODIFIED 2 parameters in new function ordonnee and exponent + VTTemp_diatoms(k) = Temp_diatoms ! track the output here + + ! Coccolithophores: + if (Temp(k) < 5.0) then + Temp_cocco = tiny + else + Temp_cocco = exp(ord_cocco + expon_cocco * Temp(k)) + Temp_cocco = max(Temp_cocco, tiny) + end if + VTTemp_cocco(k) = Temp_cocco + + ! Phaeocystis: + ! Blanchard function (Grimaud et al., 2017): + Temp_phaeo = uopt_phaeo * ((Tmax_phaeo-Temp(k))/(Tmax_phaeo-Topt_phaeo))**beta_phaeo * exp(-beta_phaeo * (Topt_phaeo-Temp(k))/(Tmax_phaeo-Topt_phaeo)) + Temp_phaeo = max(Temp_phaeo, tiny) + VTTemp_phaeo(k) = Temp_phaeo #endif #if defined (__3Zoo2Det) @@ -286,7 +377,7 @@ subroutine REcoM_sms(n,Nn,state,thick,recipthick,SurfSR,sms,Temp, Sali_depth & !< Silicate temperature dependence ! reminSiT = min(1.32e16 * exp(-11200.d0 * rTloc),reminSi) !! arrFunc control, reminSi=0.02d0 ! Kamatani (1982) ! reminSiT = reminSi - reminSiT = max(0.023d0 * 2.6d0**((Temp(k)-10.)/10.),reminSi) + reminSiT = max(0.023d0 * 2.6d0**((Temp(k)-10.)/10.),reminSi) !------------------------------------------------------------------------------- !> O2 dependence of rates @@ -308,13 +399,13 @@ subroutine REcoM_sms(n,Nn,state,thick,recipthick,SurfSR,sms,Temp, Sali_depth & chl_upper = (PhyChl + DiaChl) #if defined (__coccos) - chl_upper = chl_upper + CoccoChl + chl_upper = chl_upper + CoccoChl + PhaeoChl #endif else chl_lower = PhyChl + DiaChl #if defined (__coccos) - chl_lower = chl_lower + CoccoChl -#endif + chl_lower = chl_lower + CoccoChl + PhaeoChl +#endif Chlave = (chl_upper+chl_lower)*0.5 kappa = k_w + a_chl * (Chlave) @@ -396,12 +487,14 @@ subroutine REcoM_sms(n,Nn,state,thick,recipthick,SurfSR,sms,Temp, Sali_depth & - exp(-c_co2_phy * CO2_watercolumn(k) * Cunits) - d_co2_phy * 10.**(-pH_watercolumn(k)) PhyCO2 = min(PhyCO2,3.d0) ! April 2022: limitation to 3 PhyCO2 = max(0.d0,PhyCO2) ! July 2022: limitation to zero + VTPhyCO2(k) = PhyCO2 ! Diatoms DiaCO2 = a_co2_dia * HCO3_watercolumn(k) * Cunits / (b_co2_dia + HCO3_watercolumn(k) * Cunits) & - exp(-c_co2_dia * CO2_watercolumn(k) * Cunits) - d_co2_dia * 10.**(-pH_watercolumn(k)) DiaCO2 = min(DiaCO2,3.d0) ! April 2022: limitation to 3 DiaCO2 = max(0.d0,DiaCO2) ! July 2022: limitation to zero + VTDiaCO2(k) = DiaCO2 #if defined (__coccos) ! Coccolithophores @@ -409,9 +502,15 @@ subroutine REcoM_sms(n,Nn,state,thick,recipthick,SurfSR,sms,Temp, Sali_depth & - exp(-c_co2_cocco * CO2_watercolumn(k) * Cunits) - d_co2_cocco * 10.**(-pH_watercolumn(k)) CoccoCO2 = min(CoccoCO2,3.d0) ! April 2022: limitation to 3 CoccoCO2 = max(0.d0,CoccoCO2) ! July 2022: limitation to zero + VTCoccoCO2(k) = CoccoCO2 +! Phaeocystis + PhaeoCO2 = a_co2_phaeo * HCO3_watercolumn(k) * Cunits / (b_co2_phaeo + HCO3_watercolumn(k) * Cunits) & + - exp(-c_co2_phaeo * CO2_watercolumn(k) * Cunits) - d_co2_phaeo * 10.**(-pH_watercolumn(k)) + PhaeoCO2 = min(PHaeoCO2,3.d0) ! April 2022: limitation to 3 + PhaeoCO2 = max(0.d0,PhaeoCO2) ! July 2022: limitation to zero + VTPhaeoCO2(k) = PhaeoCO2 #endif - !------------------------------------------------------------------------------ ! Calcite dissolution dependent on OmegaC ! DISS !------------------------------------------------------------------------------ @@ -456,10 +555,15 @@ subroutine REcoM_sms(n,Nn,state,thick,recipthick,SurfSR,sms,Temp, Sali_depth & !< *** Small phytoplankton *** !< *************************** qlimitFac = recom_limiter(NMinSlope, NCmin, quota) ! Eqn A55 - feLimitFac = Fe/(k_Fe + Fe) ! Use Michaelis–Menten kinetics + feLimitFac = Fe/(k_Fe + Fe) ! Use Michaelis-Menten kinetics qlimitFac = min(qlimitFac, feLimitFac) ! Liebig law of the minimum pMax = P_cm * qlimitFac * arrFunc ! Maximum value of C-specific rate of photosynthesis - + +#if defined (__coccos) +! for 4p version which contains new Temperature functions from Hannah + pMax = qlimitFac * Temp_phyto ! Maximum value of C-specific rate of photosynthesis +#endif + !< *** Diatoms *** !< *************** qlimitFac = recom_limiter(NMinSlope, NCmin_d, quota_dia) @@ -469,13 +573,26 @@ subroutine REcoM_sms(n,Nn,state,thick,recipthick,SurfSR,sms,Temp, Sali_depth & qlimitFac = min(qlimitFac, feLimitFac) pMax_dia = P_cm_d * qlimitFac * arrFunc +#if defined (__coccos) +! for 4p version which contains new Temperature functions from Hannah + pMax_dia = qlimitFac * Temp_diatoms +#endif + !< *** Coccolithophores *** !< ************************ #if defined (__coccos) qlimitFac = recom_limiter(NMinSlope, NCmin_c, quota_cocco) feLimitFac = Fe/(k_Fe_c + Fe) qlimitFac = min(qlimitFac, feLimitFac) - pMax_cocco = P_cm_c * qlimitFac * CoccoTFunc ! Here the T dependency is changed +! pMax_cocco = P_cm_c * qlimitFac * CoccoTFunc ! Here the T dependency is changed + pMax_cocco = qlimitFac * Temp_cocco ! Here the T dependency is changed + +!< *** Phaeocystis *** +!< ******************* + qlimitFac = recom_limiter(NMinSlope, NCmin_p, quota_phaeo) + feLimitFac = Fe/(k_Fe_p + Fe) + qlimitFac = min(qlimitFac, feLimitFac) + pMax_phaeo = qlimitFac * Temp_phaeo ! Here the T dependency is changed #endif !------------------------------------------------------------------------------- !< *** Small phytoplankton photosynthesis rate *** @@ -484,20 +601,24 @@ subroutine REcoM_sms(n,Nn,state,thick,recipthick,SurfSR,sms,Temp, Sali_depth & Cphot = zero else Cphot = pMax*(real(one) - exp(-alfa * Chl2C * PARave / pMax)) + VTCphotLigLim_phyto(k) = Cphot/pMax ! track the light limitation if (CO2lim) Cphot = Cphot * PhyCO2 ! Added the CO2 dependence end if if (Cphot .lt. tiny) Cphot = zero - + VTCphot_phyto(k) = Cphot ! tracking Cphot with all processes included + !< *** Diatom photosynthesis rate *** !< ********************************** if ( pMax_dia .lt. tiny .OR. PARave /= PARave .OR. CHL2C_dia /= CHL2C_dia) then Cphot_dia = zero else Cphot_dia = pMax_dia * (real(one) - exp(-alfa_d * Chl2C_dia * PARave / pMax_dia)) + VTCphotLigLim_diatoms(k) = Cphot/pMax ! track light limitation if (CO2lim) Cphot_dia = Cphot_dia * DiaCO2 ! Added the CO2 dependence end if if (Cphot_dia .lt. tiny) Cphot_dia = zero - + VTCphot_diatoms(k) = Cphot_dia ! tracking complete Cphot + !< *** Coccolithophore photosynthesis rate *** !< ******************************************* #if defined (__coccos) @@ -505,9 +626,25 @@ subroutine REcoM_sms(n,Nn,state,thick,recipthick,SurfSR,sms,Temp, Sali_depth & Cphot_cocco = zero else Cphot_cocco = pMax_cocco * (real(one) - exp( -alfa_c * Chl2C_cocco * PARave / pMax_cocco)) + VTCphotLigLim_cocco(k) = Cphot/pMax ! track the light limitation if (CO2lim) Cphot_cocco = Cphot_cocco * CoccoCO2 ! Added the CO2 dependence end if if (Cphot_cocco .lt. tiny) Cphot_cocco = zero + VTCphot_cocco(k) = Cphot_cocco + +!< *** Phaeocystis photosynthesis rate *** +!< *************************************** + if ( pMax_phaeo .lt. tiny .OR. Parave /= Parave .OR. CHL2C_phaeo /= CHL2C_phaeo) then + Cphot_phaeo = zero + else + Cphot_phaeo = pMax_phaeo * (real(one) - exp( -alfa_p * Chl2C_phaeo * PARave / pMax_phaeo)) + VTCphotLigLim_phaeo(k) = Cphot/pMax ! track the light limitation + if (CO2lim) Cphot_phaeo = Cphot_phaeo * PhaeoCO2 ! Added the CO2 dependence + end if + if (Cphot_phaeo .lt. tiny) Cphot_phaeo = zero + VTCphot_phaeo(k) = Cphot_phaeo + + #endif !------------------------------------------------------------------------------- !< chlorophyll degradation @@ -516,6 +653,7 @@ subroutine REcoM_sms(n,Nn,state,thick,recipthick,SurfSR,sms,Temp, Sali_depth & KOchl_dia = deg_Chl_d #if defined (__coccos) KOchl_cocco = deg_Chl_c + KOchl_phaeo = deg_Chl_p #endif if (use_photodamage) then @@ -525,16 +663,20 @@ subroutine REcoM_sms(n,Nn,state,thick,recipthick,SurfSR,sms,Temp, Sali_depth & if (pMax .lt. tiny .OR. PARave /= PARave .OR. CHL2C_plast /= CHL2C_plast) then KOchl = deg_Chl*0.1d0 else - KOchl = deg_Chl*(real(one) - exp(-alfa * CHL2C_plast * PARave / pMax)) + !KOchl = deg_Chl*(real(one) - exp(-alfa * CHL2C_plast * PARave / pMax)) + KOchl = deg_Chl * CHL2C_plast * PARave KOchl = max((deg_Chl*0.1d0), KOchl) + KOchl = min(KOChl, 0.3d0) end if !< *** Diatoms Chla loss *** !< ************************* if (pMax_dia .lt. tiny .OR. PARave /= PARave .OR. CHL2C_plast_dia /= CHL2C_plast_dia) then KOchl_dia = deg_Chl_d*0.1d0 else - KOchl_dia = deg_Chl_d * (real(one) - exp(-alfa_d * CHL2C_plast_dia * PARave / pMax_dia )) + !KOchl_dia = deg_Chl_d * (real(one) - exp(-alfa_d * CHL2C_plast_dia * PARave / pMax_dia )) + KOchl_dia = deg_Chl_d * CHL2C_plast_dia * PARave KOchl_dia = max((deg_Chl_d*0.1d0), KOchl_dia) + KOchl_dia = min(KOChl_dia, 0.3d0) end if !< *** Coccolithophores chla loss *** !< ********************************** @@ -542,8 +684,21 @@ subroutine REcoM_sms(n,Nn,state,thick,recipthick,SurfSR,sms,Temp, Sali_depth & if (pMax_cocco .lt. tiny .OR. PARave /= Parave .OR. CHL2C_plast_cocco /= CHL2C_plast_cocco) then KOchl_cocco = deg_Chl_c*0.1d0 else - KOchl_cocco = deg_Chl_c * (real(one) - exp( -alfa_c * CHL2C_plast_cocco * PARave / pMax_cocco )) + !KOchl_cocco = deg_Chl_c * (real(one) - exp( -alfa_c * CHL2C_plast_cocco * PARave / pMax_cocco )) + KOchl_cocco = deg_Chl_c * CHL2C_plast_cocco * PARave KOchl_cocco = max((deg_Chl_c*0.1d0), KOchl_cocco) + KOchl_cocco = min(KOChl_cocco, 0.3d0) + end if + +!< *** Phaeocystis chla loss *** +!< ***************************** + if (pMax_phaeo .lt. tiny .OR. PARave /= PARave .OR. CHL2C_plast_phaeo /= CHL2C_plast_phaeo) then + KOchl_phaeo = deg_Chl_p*0.1d0 + else + !KOchl_phaeo = deg_Chl_p*(real(one) - exp(-alfa_p * CHL2C_plast_phaeo * PARave / pMax_phaeo)) + KOchl_phaeo = deg_Chl_p * CHL2C_plast_phaeo * PARave + KOchl_phaeo = max((deg_Chl_p*0.1d0), KOchl_phaeo) + KOchl_phaeo = min(KOChl_phaeo, 0.3d0) end if #endif if (KOchl /= KOchl) then @@ -573,7 +728,16 @@ subroutine REcoM_sms(n,Nn,state,thick,recipthick,SurfSR,sms,Temp, Sali_depth & print*,' PARave is ', PARave print*,' pMax_c is ', pMax_cocco stop - end if + end if + if (KOchl_phaeo /= KOchl_phaeo) then + print*,' KOchl_phaeo is ', KOchl_phaeo + print*,' deg_Chl_p is ', deg_Chl_p + print*,' alfa_p is ', alfa_p + print*,' CHL2C_p is ', CHL2C_plast_phaeo + print*,' PARave is ', PARave + print*,' pMax_p is ', pMax_phaeo + stop + end if #endif end if ! photodamage @@ -596,7 +760,7 @@ subroutine REcoM_sms(n,Nn,state,thick,recipthick,SurfSR,sms,Temp, Sali_depth & V_cm = V_cm_fact limitFacN = recom_limiter(NMaxSlope, quota, NCmax) N_assim = V_cm * pMax * NCuptakeRatio & ! [mmol N / (mmol C * day)] - * limitFacN * (DIN/(DIN + k_din)) ! Michaelis–Menten kinetics + * limitFacN * (DIN/(DIN + k_din)) ! Michaelis-Menten kinetics V_cm = V_cm_fact_d limitFacN_dia = recom_limiter(NMaxSlope, quota_dia, NCmax_d) @@ -607,13 +771,18 @@ subroutine REcoM_sms(n,Nn,state,thick,recipthick,SurfSR,sms,Temp, Sali_depth & V_cm = V_cm_fact_c limitFacN_cocco = recom_limiter(NMaxSlope, quota_cocco, NCmax_c) N_assim_cocco = V_cm * pMax_cocco * NCUptakeRatio_c & - * limitFacN_cocco * DIN/(DIN + k_din_c) + * limitFacN_cocco * DIN/(DIN + k_din_c) + V_cm = V_cm_fact_p + limitFacN_phaeo = recom_limiter(NMaxSlope, quota_phaeo, NCmax_p) + N_assim_phaeo = V_cm * pMax_phaeo * NCUptakeRatio_p & + * limitFacN_phaeo * DIN/(DIN + k_din_p) #endif limitFacSi = recom_limiter(SiMaxSlope, qSiC, SiCmax) & * limitFacN_dia - Si_assim = V_cm_fact_d * P_cm_d * arrFunc * SiCUptakeRatio & + Si_assim = V_cm_fact_d * Temp_diatoms * SiCUptakeRatio & * limitFacSi * Si/(Si + k_si) + VTSi_assimDia(k) = Si_assim !------------------------------------------------------------------------------- !< *** Iron chemistry *** @@ -638,11 +807,17 @@ subroutine REcoM_sms(n,Nn,state,thick,recipthick,SurfSR,sms,Temp, Sali_depth & ChlSynth_dia = N_assim_dia * Chl2N_max_d & * min(real(one),Cphot_dia /(alfa_d * Chl2C_dia * PARave)) end if + +#if defined (__coccos) ChlSynth_cocco = zero -#if defined (__coccos) if (PARave .ge. tiny .AND. PARave .eq. PARave) then ChlSynth_cocco = N_assim_cocco * Chl2N_max_c & * min(real(one),Cphot_cocco /(alfa_c * Chl2C_cocco * PARave)) + end if + ChlSynth_phaeo = zero + if (PARave .ge. tiny .AND. PARave .eq. PARave) then + ChlSynth_phaeo = N_assim_phaeo * Chl2N_max_p & + * min(real(one),Cphot_phaeo /(alfa_p * Chl2C_phaeo * PARave)) end if #endif !------------------------------------------------------------------------------- @@ -656,6 +831,7 @@ subroutine REcoM_sms(n,Nn,state,thick,recipthick,SurfSR,sms,Temp, Sali_depth & phyRespRate_dia = res_phy_d * limitFacN_dia + biosynth * N_assim_dia + biosynthSi * Si_assim #if defined (__coccos) phyRespRate_cocco = res_phy_c * limitFacN_cocco + biosynth * N_assim_cocco + phyRespRate_phaeo = res_phy_p * limitFacN_phaeo + biosynth * N_assim_phaeo ! Phaeocystis #endif !------------------------------------------------------------------------------- @@ -682,6 +858,7 @@ subroutine REcoM_sms(n,Nn,state,thick,recipthick,SurfSR,sms,Temp, Sali_depth & #endif #if defined (__coccos) aux = aux + pzCocco*CoccoN + aux = aux + pzPhaeo*PhaeoN #endif ! ****************************************************************************** varpzPhy = (pzPhy*PhyN)/aux @@ -693,6 +870,7 @@ subroutine REcoM_sms(n,Nn,state,thick,recipthick,SurfSR,sms,Temp, Sali_depth & #endif #if defined (__coccos) varpzCocco = (pzCocco*CoccoN)/aux + varpzPhaeo = (pzPhaeo*PhaeoN)/aux #endif ! ****************************************************************************** fDiaN = varpzDia * DiaN @@ -704,6 +882,7 @@ subroutine REcoM_sms(n,Nn,state,thick,recipthick,SurfSR,sms,Temp, Sali_depth & #endif #if defined (__coccos) fCoccoN = varpzCocco * CoccoN + fPhaeoN = varpzPhaeo * PhaeoN #endif else ! REcoM_Grazing_Variable_Preference = .false. fPhyN = pzPhy * PhyN @@ -714,7 +893,8 @@ subroutine REcoM_sms(n,Nn,state,thick,recipthick,SurfSR,sms,Temp, Sali_depth & fMicZooN = pzMicZoo * MicZooN ! 3Zoo #endif #if defined (__coccos) - fCoccoN = pzCocco * CoccoN + fCoccoN = pzCocco * CoccoN + fPhaeoN = pzPhaeo * PhaeoN #endif end if ! REcoM_Grazing_Variable_Preference @@ -728,6 +908,7 @@ subroutine REcoM_sms(n,Nn,state,thick,recipthick,SurfSR,sms,Temp, Sali_depth & #endif #if defined (__coccos) food = food + fCoccoN + food = food + fPhaeoN #endif ! ****************************************************************************** foodsq = food**2 @@ -744,6 +925,7 @@ subroutine REcoM_sms(n,Nn,state,thick,recipthick,SurfSR,sms,Temp, Sali_depth & #endif #if defined (__coccos) grazingFlux_Cocco = grazingFlux * fCoccoN / food + grazingFlux_Phaeo = grazingFlux * fPhaeoN / food #endif !< *** Grazing efficiency *** @@ -763,7 +945,9 @@ subroutine REcoM_sms(n,Nn,state,thick,recipthick,SurfSR,sms,Temp, Sali_depth & #endif #if defined (__coccos) grazingFluxcarbon_mes = grazingFluxcarbon_mes & - + (grazingFlux_Cocco * recipQuota_Cocco * grazEff) + + (grazingFlux_Cocco * recipQuota_Cocco * grazEff) + grazingFluxcarbon_mes = grazingFluxcarbon_mes & + + (grazingFlux_Phaeo * recipQuota_phaeo * grazEff) #endif !------------------------------------------------------------------------------- @@ -777,8 +961,9 @@ subroutine REcoM_sms(n,Nn,state,thick,recipthick,SurfSR,sms,Temp, Sali_depth & !< pzPhy2: Maximum nanophytoplankton preference !< pzDia2: Maximum diatom preference !< pzCocco2: Maximum coccolithophore preference -!< pzDet2: Maximum slow-sinking detritus prefence -!< pzDetZ22: Maximum fast-sinking detritus preference +!< pzPhaeo2: Maximum phaeocystis preference +!< pzDet2: Maximum slow-sinking detritus prefence by macrozooplankton +!< pzDetZ22: Maximum fast-sinking detritus preference by macrozooplankton !< pzHet: Maximum mesozooplankton preference !< pzMicZoo2: Maximum microzooplankton preference @@ -789,6 +974,7 @@ subroutine REcoM_sms(n,Nn,state,thick,recipthick,SurfSR,sms,Temp, Sali_depth & aux = aux + pzMicZoo2 * MicZooN ! 3Zoo #if defined (__coccos) aux = aux + pzCocco2 * CoccoN + aux = aux + pzPhaeo2 * PhaeoN #endif ! ****************************************************************************** varpzPhy2 = (pzPhy2 * PhyN)/aux @@ -796,7 +982,8 @@ subroutine REcoM_sms(n,Nn,state,thick,recipthick,SurfSR,sms,Temp, Sali_depth & varpzMicZoo2 = (pzMicZoo2 * MicZooN)/aux ! 3Zoo #if defined (__coccos) - varpzCocco2 = (pzCocco2 * CoccoN)/aux + varpzCocco2 = (pzCocco2 * CoccoN)/aux + varpzPhaeo2 = (pzPhaeo2 * PhaeoN)/aux #endif varpzHet = (pzHet * HetN)/aux if (Grazing_detritus) then @@ -809,6 +996,7 @@ subroutine REcoM_sms(n,Nn,state,thick,recipthick,SurfSR,sms,Temp, Sali_depth & fMicZooN2 = varpzMicZoo2 * MicZooN ! 3Zoo #if defined (__coccos) fCoccoN2 = varpzCocco2 * CoccoN + fPhaeoN2 = varpzPhaeo2 * PhaeoN #endif fHetN = varpzHet * HetN if (Grazing_detritus) then @@ -821,7 +1009,8 @@ subroutine REcoM_sms(n,Nn,state,thick,recipthick,SurfSR,sms,Temp, Sali_depth & fPhyN2 = pzPhy2 * PhyN fMicZooN2 = pzMicZoo2 * MicZooN ! 3Zoo #if defined (__coccos) - fCoccoN2 = pzCocco2 * CoccoN + fCoccoN2 = pzCocco2 * CoccoN + fPhaeoN2 = pzPhaeo2 * PhaeoN #endif fHetN = pzHet * HetN if (Grazing_detritus) then @@ -837,6 +1026,7 @@ subroutine REcoM_sms(n,Nn,state,thick,recipthick,SurfSR,sms,Temp, Sali_depth & food2 = food2 + fMicZooN2 ! 3Zoo #if defined (__coccos) food2 = food2 + fCoccoN2 + food2 = food2 + fPhaeoN2 #endif ! ****************************************************************************** foodsq2 = food2**2 @@ -848,6 +1038,7 @@ subroutine REcoM_sms(n,Nn,state,thick,recipthick,SurfSR,sms,Temp, Sali_depth & #if defined (__coccos) grazingFlux_Cocco2 = (grazingFlux2 * fCoccoN2)/food2 + grazingFlux_Phaeo2 = (grazingFlux2 * fPhaeoN2)/food2 #endif grazingFlux_het2 = (grazingFlux2 * fHetN)/food2 if (Grazing_detritus) then @@ -868,35 +1059,41 @@ subroutine REcoM_sms(n,Nn,state,thick,recipthick,SurfSR,sms,Temp, Sali_depth & #if defined (__coccos) grazingFluxcarbonzoo2 = grazingFluxcarbonzoo2 + & + (grazingFlux_Cocco2 * recipQuota_Cocco * grazEff2) + grazingFluxcarbonzoo2 = grazingFluxcarbonzoo2 + & + + (grazingFlux_Phaeo2 * recipQuota_Phaeo * grazEff2) #endif !------------------------------------------------------------------------------- ! Third Zooplankton (Microzooplankton) !------------------------------------------------------------------------------- -!< Grazing on small phytoplankton, diatoms and coccolithophore (optional) +!< Grazing on small phytoplankton, diatoms and coccolithophore (optional) and phaeocystis (optional) !< *** Food availability *** !< ************************* !< pzPhy3: Maximum nanophytoplankton preference !< pzDia3: Maximum diatom preference !< pzCocco3: Maximum coccolithophore preference +!< pzPhaeo3: Maximum phaeocystis preference if (REcoM_Grazing_Variable_Preference) then aux = pzPhy3 * PhyN + pzDia3 * DiaN #if defined (__coccos) aux = aux + pzCocco3 * CoccoN + aux = aux + pzPhaeo3 * PhaeoN #endif ! ****************************************************************************** varpzPhy3 = (pzPhy3 * PhyN)/aux varpzDia3 = (pzDia3 * DiaN)/aux #if defined (__coccos) varpzCocco3 = (pzCocco3 * CoccoN)/aux + varpzPhaeo3 = (pzPhaeo3 * PhaeoN)/aux #endif ! ****************************************************************************** fPhyN3 = varpzPhy3 * PhyN fDiaN3 = varpzDia3 * DiaN #if defined (__coccos) fCoccoN3 = varpzCocco3 * CoccoN + fPhaeoN3 = varpzPhaeo3 * PhaeoN #endif else ! REcoM_Grazing_Variable_Preference = .false. @@ -904,6 +1101,7 @@ subroutine REcoM_sms(n,Nn,state,thick,recipthick,SurfSR,sms,Temp, Sali_depth & fDiaN3 = pzDia3 * DiaN #if defined (__coccos) fCoccoN3 = pzCocco3 * CoccoN + fPhaeoN3 = pzPhaeo3 * PhaeoN #endif endif !REcoM_Grazing_Variable_Preference @@ -912,6 +1110,7 @@ subroutine REcoM_sms(n,Nn,state,thick,recipthick,SurfSR,sms,Temp, Sali_depth & food3 = fPhyN3 + fDiaN3 #if defined (__coccos) food3 = food3 + fCoccoN3 + food3 = food3 + fPhaeoN3 #endif ! ****************************************************************************** foodsq3 = food3**2 @@ -920,6 +1119,7 @@ subroutine REcoM_sms(n,Nn,state,thick,recipthick,SurfSR,sms,Temp, Sali_depth & grazingFlux_Dia3 = (grazingFlux3 * fDiaN3)/food3 #if defined (__coccos) grazingFlux_Cocco3 = (grazingFlux3 * fCoccoN3)/food3 + grazingFlux_Phaeo3 = (grazingFlux3 * fPhaeoN3)/food3 #endif #endif @@ -939,6 +1139,18 @@ subroutine REcoM_sms(n,Nn,state,thick,recipthick,SurfSR,sms,Temp, Sali_depth & HetRespFlux = max(zero, HetRespFlux) !!!!!!!! CHECK Judith Valid for het_resp_noredfield case as well ???????? Then move it below endif + if (ciso) then +!MB set HetRespFlux_plus = .true. in namelist.recom +! HetRespFlux_13 = max(zero, recip_res_het * arrFunc * (hetC_13 * recip_hetN_plus - redfield) * HetC_13) +! Numerically safer parametrization avoiding instable results which may result from different cutoff values -- CHECK + HetRespFlux_13 = HetRespFlux * HetC_13 / HetC +!! HetRespFlux_13 = HetRespFlux * (HetC_13 / HetC) **2 + if (ciso_14 .and. ciso_organic_14) then +! HetRespFlux_14 = max(zero, recip_res_het * arrFunc * (hetC_14 * recip_hetN_plus - redfield) * HetC_14) + HetRespFlux_14 = HetRespFlux * HetC_14 / HetC +!! HetRespFlux_14 = HetRespFlux * (HetC_14 / HetC) **2 + end if + end if !------------------------------------------------------------------------------- !< Zooplanton mortality (Quadratic) @@ -1006,6 +1218,7 @@ subroutine REcoM_sms(n,Nn,state,thick,recipthick,SurfSR,sms,Temp, Sali_depth & #endif #if defined (__coccos) aggregationrate = aggregationrate + agg_PP * CoccoN + aggregationrate = aggregationrate + agg_PP * PhaeoN #endif !------------------------------------------------------------------------------- @@ -1059,6 +1272,19 @@ subroutine REcoM_sms(n,Nn,state,thick,recipthick,SurfSR,sms,Temp, Sali_depth & calc_loss_gra3 = grazingFlux_phy3 * aux ! 3Zoo #endif #endif + + if (ciso) then + calcification_13 = calc_prod_ratio * Cphot * PhyC_13 * alpha_calc_13 + calcification_13 = calcification * alpha_calc_13 + calc_loss_agg_13 = aggregationRate * PhyCalc_13 + calc_loss_gra_13 = grazingFlux_phy * recipQuota_13/(PhyC_13 + tiny) * PhyCalc_13 + if (ciso_14 .and. ciso_organic_14) then + calcification_14 = calc_prod_ratio * Cphot * PhyC_14 * alpha_calc_14 + calc_loss_agg_14 = aggregationRate * PhyCalc_14 + calc_loss_gra_14 = grazingFlux_phy * recipQuota_14/(PhyC_14 + tiny) * PhyCalc_14 + end if + end if + !------------------------------------------------------------------------------- ! Sources minus sinks (SMS) !------------------------------------------------------------------------------- @@ -1084,6 +1310,7 @@ subroutine REcoM_sms(n,Nn,state,thick,recipthick,SurfSR,sms,Temp, Sali_depth & - N_assim_Dia * DiaC & ! --> N assimilation Diatoms #if defined (__coccos) - N_assim_Cocco * CoccoC & ! --> N assimilation Coccolithophore + - N_assim_Phaeo * PhaeoC & ! --> N assimilation Phaeocystis #endif + rho_N * arrFunc * O2Func * DON & ! --> DON remineralization, temperature dependent [day^-1 * mmol/m3] ! O2remin ) * dt_b + sms(k,idin) @@ -1101,6 +1328,8 @@ subroutine REcoM_sms(n,Nn,state,thick,recipthick,SurfSR,sms,Temp, Sali_depth & #if defined (__coccos) - Cphot_Cocco * CoccoC & ! --> Coccolithophore photosynthesis + phyRespRate_Cocco * CoccoC & ! --> Coccolithophore respiration + - Cphot_Phaeo * PhaeoC & ! --> Phaeocystis photosynthesis + + phyRespRate_Phaeo * PhaeoC & ! --> Phaeocystis respiration #endif + rho_C1 * arrFunc * O2Func * EOC & ! --> Remineralization of DOC ! NEW O2remin + HetRespFlux & ! --> Mesozooplankton respiration @@ -1145,7 +1374,8 @@ subroutine REcoM_sms(n,Nn,state,thick,recipthick,SurfSR,sms,Temp, Sali_depth & + 1.0625 * N_assim * PhyC & + 1.0625 * N_assim_Dia * DiaC & #if defined (__coccos) - + 1.0625 * N_assim_Cocco * CoccoC & + + 1.0625 * N_assim_Cocco * CoccoC & + + 1.0625 * N_assim_Phaeo * PhaeoC & #endif - 1.0625 * rho_N * arrFunc * O2Func * DON & ! O2remin + 2.d0 * calc_diss * DetCalc & @@ -1204,7 +1434,7 @@ subroutine REcoM_sms(n,Nn,state,thick,recipthick,SurfSR,sms,Temp, Sali_depth & + chlSynth * PhyC & ! --> Chl-a synthesis - KOchl * PhyChl & ! --> Degradation loss - aggregationRate * PhyChl & ! --> Aggregation loss - - grazingFlux_phy * Chl2N & ! --> Grazing loss + - grazingFlux_phy * Chl2N & ! --> Grazing loss #if defined (__3Zoo2Det) - grazingFlux_phy2 * Chl2N & - grazingFlux_phy3 * Chl2N & ! 3Zoo @@ -1219,25 +1449,28 @@ subroutine REcoM_sms(n,Nn,state,thick,recipthick,SurfSR,sms,Temp, Sali_depth & if (Grazing_detritus) then #if defined (__3Zoo2Det) sms(k,idetn) = ( & - + grazingFlux_phy3 & - - grazingFlux_phy3 * grazEff3 & - + grazingFlux_dia3 & - - grazingFlux_dia3 * grazEff3 & + + grazingFlux_phy3 & ! --> grazing on small phytoplankton by third zooplankton + - grazingFlux_phy3 * grazEff3 & ! --> fraction of grazingFlux_phy3 into microzooplankton pool + + grazingFlux_dia3 & ! --> grazing on diatoms by third zooplankton + - grazingFlux_dia3 * grazEff3 & ! --> fraction of grazingFlux_dia3 into microzooplankton pool #if defined (__coccos) - + grazingFlux_Cocco3 & - - grazingFlux_Cocco3 * grazEff3 & + + grazingFlux_Cocco3 & ! --> grazing on coccolithophores by third zooplankton + - grazingFlux_Cocco3 * grazEff3 & ! --> fraction of grazingFlux_Cocco3 into microzooplankton pool + aggregationRate * CoccoN & + + grazingFlux_Phaeo3 * & ! --> grazing on phaeocystis by third zooplankton + - grazingFlux_Phaeo3 * grazEff3 & ! --> fraction of grazingFlux_Phaeo3 into microzooplankton pool + + aggregationRate * PhaeoN & #endif - - grazingFlux_Det * grazEff & - - grazingFlux_Det2 * grazEff2 & ! --> okay, grazing of second zoo on first detritus + - grazingFlux_Det * grazEff & ! --> grazing of first zoo (meso) on first detritus class + - grazingFlux_Det2 * grazEff2 & ! --> grazing of second zoo (macro) on first detritus class + aggregationRate * PhyN & + aggregationRate * DiaN & - + miczooLossFlux & - - reminN * arrFunc * O2Func * DetN & ! O2remin + + miczooLossFlux & ! --> microzooplankton, mortality + - reminN * arrFunc * O2Func * DetN & ! --> O2remin ) * dt_b + sms(k,idetn) #else sms(k,idetn) = ( & - + grazingFlux_phy & + + grazingFlux_phy & ! Technically it is mesooooooooooooooooo - grazingFlux_phy * grazEff & + grazingFlux_dia & - grazingFlux_dia * grazEff & @@ -1245,6 +1478,9 @@ subroutine REcoM_sms(n,Nn,state,thick,recipthick,SurfSR,sms,Temp, Sali_depth & + grazingFlux_Cocco & - grazingFlux_Cocco * grazEff & + aggregationRate * CoccoN & + + grazingFlux_Phaeo * & + - grazingFlux_Phaeo * grazEff & + + aggregationRate * PhaeoN & #endif - grazingFlux_Det * grazEff & ! Sloppy feeding is thought because of grazing flux multiplied with grazeff - grazingFlux_Det2 * grazEff2 & !!!!!!!!!!CHECK @@ -1262,6 +1498,8 @@ subroutine REcoM_sms(n,Nn,state,thick,recipthick,SurfSR,sms,Temp, Sali_depth & #if defined (__coccos) + grazingFlux_Cocco3 & + aggregationRate * CoccoN & + + grazingFlux_Phaeo3 * & + + aggregationRate * PhaeoN & #endif - grazingFlux * grazEff3 & + aggregationRate * PhyN & @@ -1275,7 +1513,9 @@ subroutine REcoM_sms(n,Nn,state,thick,recipthick,SurfSR,sms,Temp, Sali_depth & + grazingFlux_dia & #if defined (__coccos) + grazingFlux_Cocco & - + aggregationRate * CoccoN & + + aggregationRate * CoccoN & + + grazingFlux_Phaeo * & + + aggregationRate * PhaeoN & #endif - grazingFlux * grazEff & + aggregationRate * PhyN & @@ -1299,9 +1539,12 @@ subroutine REcoM_sms(n,Nn,state,thick,recipthick,SurfSR,sms,Temp, Sali_depth & + grazingFlux_Cocco3 * recipQuota_Cocco & - grazingFlux_Cocco3 * recipQuota_Cocco * grazEff3 & + aggregationRate * CoccoC & + + grazingFlux_Phaeo3 * recipQuota_Phaeo & + - grazingFlux_Phaeo3 * recipQuota_Phaeo * grazEff3 & + + aggregationRate * PhaeoC & #endif - grazingFlux_Det * recipDet * grazEff & - - grazingFlux_Det2 * recipDet2 * grazEff2 & + - grazingFlux_Det2 * recipDet * grazEff2 & ! corrected recipDet2 -> recipDet + aggregationRate * PhyC & + aggregationRate * DiaC & + miczooLossFlux * recipQZoo3 & @@ -1317,9 +1560,12 @@ subroutine REcoM_sms(n,Nn,state,thick,recipthick,SurfSR,sms,Temp, Sali_depth & + grazingFlux_Cocco * recipQuota_Cocco & - grazingFlux_Cocco * recipQuota_Cocco * grazEff & + aggregationRate * CoccoC & + + grazingFlux_Phaeo * recipQuota_Phaeo & + - grazingFlux_Phaeo * recipQuota_Phaeo * grazEff & + + aggregationRate * PhaeoC & #endif - grazingFlux_Det * recipDet * grazEff & - - grazingFlux_Det2 * recipDet2 * grazEff & !!!!!! CHECK + ! - grazingFlux_Det2 * recipDet2 * grazEff & !!!!!! CHECK + aggregationRate * phyC & + aggregationRate * DiaC & + hetLossFlux * recipQZoo & @@ -1337,6 +1583,9 @@ subroutine REcoM_sms(n,Nn,state,thick,recipthick,SurfSR,sms,Temp, Sali_depth & + grazingFlux_Cocco3 * recipQuota_Cocco & - grazingFlux_Cocco3 * recipQuota_Cocco * grazEff3 & + aggregationRate * CoccoC & + + grazingFlux_Phaeo3 * recipQuota_Phaeo & + - grazingFlux_Phaeo3 * recipQuota_Phaeo * grazEff3 & + + aggregationRate * PhaeoC & #endif + aggregationRate * PhyC & + aggregationRate * DiaC & @@ -1352,7 +1601,10 @@ subroutine REcoM_sms(n,Nn,state,thick,recipthick,SurfSR,sms,Temp, Sali_depth & #if defined (__coccos) + grazingFlux_Cocco * recipQuota_Cocco & - grazingFlux_Cocco * recipQuota_Cocco * grazEff & - + aggregationRate * CoccoC & + + aggregationRate * CoccoC & + + grazingFlux_Phaeo * recipQuota_Phaeo & + - grazingFlux_Phaeo * recipQuota_Phaeo * grazEff & + + aggregationRate * PhaeoC & #endif + aggregationRate * phyC & + aggregationRate * DiaC & @@ -1368,22 +1620,23 @@ subroutine REcoM_sms(n,Nn,state,thick,recipthick,SurfSR,sms,Temp, Sali_depth & !____________________________________________________________ !< Heterotrophic N sms(k,ihetn) = ( & - + grazingFlux * grazEff & ! --> Grazing on phytoplankton -> okay, because of recipQuota + + grazingFlux * grazEff & ! --> Grazing on phytoplankton -> okay, because of recipQuota #if defined (__3Zoo2Det) - grazingFlux_het2 & - Mesfecalloss_n & ! 3Zoo #endif - - hetLossFlux & ! --> Mortality - - lossN_z * HetN & ! --> Excretion of DON + - hetLossFlux & ! --> Mortality + - lossN_z * HetN & ! --> Excretion of DON ) * dt_b + sms(k,ihetn) !____________________________________________________________ !< Heterotrophic C if (Grazing_detritus) then sms(k,ihetc) = ( & - + grazingFlux_phy * recipQuota * grazEff & ! --> Grazing on small phytoplankton - + grazingFlux_Dia * recipQuota_Dia * grazEff & ! --> Grazing on diatom + + grazingFlux_phy * recipQuota * grazEff & ! --> Grazing on small phytoplankton + + grazingFlux_Dia * recipQuota_Dia * grazEff & ! --> Grazing on diatom #if defined (__coccos) - + grazingFlux_Cocco * recipQuota_Cocco * grazEff & + + grazingFlux_Cocco * recipQuota_Cocco * grazEff & + + grazingFlux_Phaeo * recipQuota_Phaeo * grazEff & #endif #if defined (__3Zoo2Det) + grazingFlux_miczoo * recipQZoo3 * grazEff & ! 3Zoo @@ -1392,25 +1645,26 @@ subroutine REcoM_sms(n,Nn,state,thick,recipthick,SurfSR,sms,Temp, Sali_depth & - Mesfecalloss_c & ! 3Zoo #endif + grazingFlux_Det * recipDet * grazEff & ! --> Grazing on detritus - - hetLossFlux * recipQZoo & ! --> Mortality loss - - lossC_z * HetC & ! --> Excretion loss - - hetRespFlux & ! --> REspiration loss + - hetLossFlux * recipQZoo & ! --> Mortality loss + - lossC_z * HetC & ! --> Excretion loss + - hetRespFlux & ! --> REspiration loss ) * dt_b + sms(k,ihetc) else sms(k,ihetc) = ( & - + grazingFlux_phy * recipQuota * grazEff & - + grazingFlux_Dia * recipQuota_Dia * grazEff & + + grazingFlux_phy * recipQuota * grazEff & + + grazingFlux_Dia * recipQuota_Dia * grazEff & #if defined (__coccos) + grazingFlux_Cocco * recipQuota_Cocco * grazEff & + + grazingFlux_Phaeo * recipQuota_Phaeo * grazEff & #endif #if defined (__3Zoo2Det) + grazingFlux_miczoo * recipQZoo3 * grazEff & ! 3Zoo - grazingFlux_het2 * recipQZoo & - Mesfecalloss_c & ! 3Zoo #endif - - hetLossFlux * recipQZoo & - - lossC_z * HetC & - - hetRespFlux & + - hetLossFlux * recipQZoo & + - lossC_z * HetC & + - hetRespFlux & ) * dt_b + sms(k,ihetc) endif @@ -1436,6 +1690,7 @@ subroutine REcoM_sms(n,Nn,state,thick,recipthick,SurfSR,sms,Temp, Sali_depth & + grazingFlux_Dia2 * recipQuota_Dia * grazEff2 & #if defined (__coccos) + grazingFlux_Cocco2 * recipQuota_Cocco * grazEff2 & + + grazingFlux_Phaeo2 * recipQuota_Phaeo * grazEff2 & #endif + grazingFlux_het2 * recipQZoo * grazEff2 & + grazingFlux_miczoo2* recipQZoo3 * grazEff2 & ! 3Zoo @@ -1452,6 +1707,7 @@ subroutine REcoM_sms(n,Nn,state,thick,recipthick,SurfSR,sms,Temp, Sali_depth & + grazingFlux_Dia2 * recipQuota_Dia * grazEff2 & #if defined (__coccos) + grazingFlux_Cocco2 * recipQuota_Cocco * grazEff2 & + + grazingFlux_Phaeo2 * recipQuota_Phaeo * grazEff2 & #endif + grazingFlux_het2 * recipQZoo * grazEff2 & + grazingFlux_miczoo2* recipQZoo3 * grazEff2 & ! 3Zoo @@ -1482,6 +1738,7 @@ subroutine REcoM_sms(n,Nn,state,thick,recipthick,SurfSR,sms,Temp, Sali_depth & + grazingFlux_Dia3 * recipQuota_Dia * grazEff3 & #if defined (__coccos) + grazingFlux_Cocco3 * recipQuota_Cocco * grazEff3 & + + grazingFlux_Phaeo3 * recipQuota_Phaeo * grazEff3 & #endif - MicZooLossFlux * recipQZoo3 & - grazingFlux_miczoo * recipQZoo3 & @@ -1494,7 +1751,7 @@ subroutine REcoM_sms(n,Nn,state,thick,recipthick,SurfSR,sms,Temp, Sali_depth & !< ***************************** !____________________________________________________________ -!< Second Zooplankton Detritus N +!< Second Zooplankton (Macro) Detritus N if (Grazing_detritus) then sms(k,idetz2n) = ( & + grazingFlux_phy2 & @@ -1506,6 +1763,10 @@ subroutine REcoM_sms(n,Nn,state,thick,recipthick,SurfSR,sms,Temp, Sali_depth & - grazingFlux_Cocco * grazEff & + grazingFlux_Cocco2 & - grazingFlux_Cocco2 * grazEff2 & + + grazingFlux_Phaeo & + - grazingFlux_Phaeo * grazEff & + + grazingFlux_Phaeo2 & + - grazingFlux_Phaeo2 * grazEff2 & #endif + grazingFlux_het2 & - grazingFlux_het2 * grazEff2 & @@ -1532,6 +1793,8 @@ subroutine REcoM_sms(n,Nn,state,thick,recipthick,SurfSR,sms,Temp, Sali_depth & #if defined (__coccos) + grazingFlux_Cocco & + grazingFlux_Cocco2 & + + grazingFlux_Phaeo & + + grazingFlux_Phaeo2 & #endif + grazingFlux_het2 & + grazingFlux_miczoo2 & @@ -1560,7 +1823,11 @@ subroutine REcoM_sms(n,Nn,state,thick,recipthick,SurfSR,sms,Temp, Sali_depth & + grazingFlux_Cocco * recipQuota_Cocco & - grazingFlux_Cocco * recipQuota_Cocco * grazEff & + grazingFlux_Cocco2 * recipQuota_Cocco & - - grazingFlux_Cocco2 * recipQuota_Cocco * grazEff2 & + - grazingFlux_Cocco2 * recipQuota_Cocco * grazEff2 & + + grazingFlux_Phaeo * recipQuota_Phaeo & + - grazingFlux_Phaeo * recipQuota_Phaeo * grazEff & + + grazingFlux_Phaeo2 * recipQuota_Phaeo & + - grazingFlux_Phaeo2 * recipQuota_Phaeo * grazEff2 & #endif + grazingFlux_het2 * recipQZoo & - grazingFlux_het2 * recipQZoo * grazEff2 & @@ -1590,7 +1857,11 @@ subroutine REcoM_sms(n,Nn,state,thick,recipthick,SurfSR,sms,Temp, Sali_depth & + grazingFlux_Cocco * recipQuota_Cocco & - grazingFlux_Cocco * recipQuota_Cocco * grazEff & + grazingFlux_Cocco2 * recipQuota_Cocco & - - grazingFlux_Cocco2 * recipQuota_Cocco * grazEff2 & + - grazingFlux_Cocco2 * recipQuota_Cocco * grazEff2 & + + grazingFlux_Phaeo * recipQuota_Phaeo & + - grazingFlux_Phaeo * recipQuota_Phaeo * grazEff & + + grazingFlux_Phaeo2 * recipQuota_Phaeo & + - grazingFlux_Phaeo2 * recipQuota_Phaeo * grazEff2 & #endif + grazingFlux_het2 * recipQZoo & - grazingFlux_het2 * recipQZoo * grazEff2 & @@ -1639,7 +1910,8 @@ subroutine REcoM_sms(n,Nn,state,thick,recipthick,SurfSR,sms,Temp, Sali_depth & + lossN * limitFacN * phyN & + lossN_d * limitFacN_Dia * DiaN & #if defined (__coccos) - + lossN_c * limitFacN_Cocco * CoccoN & + + lossN_c * limitFacN_Cocco * CoccoN & + + lossN_p * limitFacN_Phaeo * PhaeoN & #endif + reminN * arrFunc * O2Func * DetN & + lossN_z * HetN & @@ -1659,6 +1931,7 @@ subroutine REcoM_sms(n,Nn,state,thick,recipthick,SurfSR,sms,Temp, Sali_depth & + lossC_d * limitFacN_dia * DiaC & #if defined (__coccos) + lossC_c * limitFacN_cocco * CoccoC & + + lossC_p * limitFacN_Phaeo * PhaeoC & #endif + reminC * arrFunc * O2Func * DetC & + lossC_z * HetC & @@ -1668,7 +1941,7 @@ subroutine REcoM_sms(n,Nn,state,thick,recipthick,SurfSR,sms,Temp, Sali_depth & + lossC_z3 * MicZooC & ! 3Zoo #endif - rho_c1 * arrFunc * O2Func * EOC & ! O2remin - ) * dt_b + sms(k,idoc) + ) * dt_b + sms(k,idoc) !< *** Diatoms *** !< *************** @@ -1710,7 +1983,7 @@ subroutine REcoM_sms(n,Nn,state,thick,recipthick,SurfSR,sms,Temp, Sali_depth & - grazingFlux_dia2 * recipQuota_dia & - grazingFlux_dia3 * recipQuota_dia & ! 3Zoo #endif - ) * dt_b + sms(k,idiac) + ) * dt_b + sms(k,idiac) !____________________________________________________________ !< Diatom Chl @@ -1812,7 +2085,62 @@ subroutine REcoM_sms(n,Nn,state,thick,recipthick,SurfSR,sms,Temp, Sali_depth & - grazingFlux_Cocco3 * Chl2N_cocco & ! 3Zoo #endif ) * dt_b + sms(k,icchl) + +!< *** Phaeocystis *** +!< ******************* + +!____________________________________________________________ +!< Phaeocystis N + +!< lossN_p: Phaeocystis loss of organic N compounds [day^-1] + + sms(k,iphan) = ( & + + N_assim_phaeo * PhaeoC & ! --> N assimilation + - lossN_p * limitFacN_phaeo * PhaeoN & ! --> DON excretion + - aggregationRate * PhaeoN & ! --> Aggregation loss + - grazingFlux_phaeo & ! --> Grazing loss +#if defined (__3Zoo2Det) + - grazingFlux_phaeo2 & + - grazingFlux_phaeo3 & ! 3Zoo +#endif + ) * dt_b + sms(k,iphan) +!____________________________________________________________ +!< Phaeocystis C + +!< lossC_p: Phaeocystis loss of carbon [day^-1] +!< When N : C ratio becomes too high, excretion of DOC is downregulated +!< by the limiter function limitFacN +!< aggregationRate transfers C to the detritus pool + + sms(k,iphac) = ( & + + Cphot_phaeo * PhaeoC & ! --> Photosynthesis ---->/ + - lossC_p * limitFacN_phaeo * PhaeoC & ! --> Excretion of DOC / Net photosynthesis + - phyRespRate_phaeo * PhaeoC & ! --> Respiration ----->/ + - aggregationRate * PhaeoC & ! --> Aggregation loss + - grazingFlux_phaeo * recipQuota_phaeo & ! --> Grazing loss +#if defined (__3Zoo2Det) + - grazingFlux_phaeo2 * recipQuota_phaeo & + - grazingFlux_phaeo3 * recipQuota_phaeo & ! 3Zoo #endif + ) * dt_b + sms(k,iphac) +!__________________________________________________________ +! Phaeocystis ChlA + +!< Chl2N: Conversion factor from mmolN to mgChla +!< Chl2N = PhyChl/PhyN + + sms(k,iphachl) = ( & + + chlSynth_phaeo * PhaeoC & ! --> Chl-a synthesis + - KOchl_phaeo * PhaeoChl & ! --> Degradation loss + - aggregationRate * PhaeoChl & ! --> Aggregation loss + - grazingFlux_phaeo * Chl2N_phaeo & ! --> Grazing loss +#if defined (__3Zoo2Det) + - grazingFlux_phaeo2 * Chl2N_phaeo & + - grazingFlux_phaeo3 * Chl2N_phaeo & ! 3Zoo +#endif + ) * dt_b + sms(k,iphachl) +#endif + !< *** Silicate *** !< **************** @@ -1883,6 +2211,8 @@ subroutine REcoM_sms(n,Nn,state,thick,recipthick,SurfSR,sms,Temp, Sali_depth & #if defined (__coccos) - N_assim_cocco * CoccoC & + lossN_c * limitFacN_cocco * CoccoN & + - N_assim_phaeo * PhaeoC & + + lossN_p * limitFacN_phaeo * PhaeoN & #endif + lossN * limitFacN * PhyN & ! --> Excretion from small pythoplankton + lossN_d * limitFacN_dia * DiaN & ! --> Excretion from diatom @@ -1992,6 +2322,8 @@ subroutine REcoM_sms(n,Nn,state,thick,recipthick,SurfSR,sms,Temp, Sali_depth & #if defined (__coccos) + Cphot_cocco * CoccoC & - phyRespRate_cocco * CoccoC & + + Cphot_phaeo * PhaeoC & + - phyRespRate_phaeo * PhaeoC & #endif - rho_C1 * arrFunc * O2Func * EOC & ! O2remin - hetRespFlux & @@ -2001,10 +2333,184 @@ subroutine REcoM_sms(n,Nn,state,thick,recipthick,SurfSR,sms,Temp, Sali_depth & #endif ) * redO2C * dt_b + sms(k,ioxy) ! + if (ciso) then +!------------------------------------------------------------------------------- +! DIC_13 + sms(k,idic_13) = ( & + - Cphot * PhyC_13 & + + phyRespRate * PhyC_13 & + - Cphot_Dia * DiaC_13 & + + phyRespRate_Dia * DiaC_13 & + + rho_C1 * arrFunc * EOC_13 & + + HetRespFlux_13 & + + calc_diss_13 * DetCalc_13 & + + calc_loss_gra_13 * calc_diss_guts & + - calcification_13 & + ) * dt_b + sms(k,idic_13) +!------------------------------------------------------------------------------- +! Phytoplankton C_13 + sms(k,iphyc_13) = ( & + + Cphot * PhyC_13 & + - lossC * limitFacN * PhyC_13 & + - phyRespRate * PhyC_13 & + - aggregationRate * PhyC_13 & + - grazingFlux_phy * recipQuota_13 & + ) * dt_b + sms(k,iphyc_13) +!------------------------------------------------------------------------------- +! Detritus C_13 + sms(k,idetc_13) = ( & + + grazingFlux_phy * recipQuota_13 & + - grazingFlux_phy * recipQuota_13 * grazEff & + + grazingFlux_Dia * recipQuota_dia_13 & + - grazingFlux_Dia * recipQuota_dia_13 * grazEff & + + aggregationRate * phyC_13 & + + aggregationRate * DiaC_13 & + + hetLossFlux * recipQZoo_13 & + - reminC * arrFunc * DetC_13 & + ) * dt_b + sms(k,idetc_13) +!------------------------------------------------------------------------------- +! Heterotrophic C_13 + sms(k,ihetc_13) = ( & + + grazingFlux_phy * recipQuota_13 * grazEff & + + grazingFlux_Dia * recipQuota_dia_13 * grazEff & + - hetLossFlux * recipQZoo_13 & + - lossC_z * HetC_13 & + - hetRespFlux_13 & + ) * dt_b + sms(k,ihetc_13) +!------------------------------------------------------------------------------- +! EOC_13 + sms(k,idoc_13) = ( & + + lossC * limitFacN * phyC_13 & + + lossC_d * limitFacN_dia * DiaC_13 & + + reminC * arrFunc * DetC_13 & + + lossC_z * HetC_13 & + - rho_c1 * arrFunc * EOC_13 & + + LocRiverDOC * r_iorg_13 & + ) * dt_b + sms(k,idoc_13) +!------------------------------------------------------------------------------- +! Diatom C_13 + sms(k,idiac_13) = ( & + + Cphot_dia * DiaC_13 & + - lossC_d * limitFacN_dia * DiaC_13 & + - phyRespRate_dia * DiaC_13 & + - aggregationRate * DiaC_13 & + - grazingFlux_dia * recipQuota_dia_13 & + ) * dt_b + sms(k,idiac_13) +!------------------------------------------------------------------------------- +! Small phytoplankton calcite_13 + sms(k,iphycal_13) = ( & + + calcification_13 & + - lossC * limitFacN * phyCalc_13 & + - phyRespRate * phyCalc_13 & + - calc_loss_agg_13 & + - calc_loss_gra_13 & + ) * dt_b + sms(k,iphycal_13) +!------------------------------------------------------------------------------- +! Detritus calcite_13 + sms(k,idetcal_13) = ( & + + lossC * limitFacN * phyCalc_13 & + + phyRespRate * phyCalc_13 & + + calc_loss_agg_13 & + + calc_loss_gra_13 & + - calc_loss_gra_13 * calc_diss_guts & + - calc_diss_13 * DetCalc_13 & + ) * dt_b + sms(k,idetcal_13) +!------------------------------------------------------------------------------- + if (ciso_14) then +!------------------------------------------------------------------------------- + if (ciso_organic_14) then +! DIC_14 + sms(k,idic_14) = ( & + - Cphot * PhyC_14 & + + phyRespRate * PhyC_14 & + - Cphot_Dia * DiaC_14 & + + phyRespRate_Dia * DiaC_14 & + + rho_C1 * arrFunc * EOC_14 & + + HetRespFlux_14 & + + calc_diss_14 * DetCalc_14 & + + calc_loss_gra_14 * calc_diss_guts & + - calcification_14 & + ) * dt_b + sms(k,idic_14) +!------------------------------------------------------------------------------- +! Phytoplankton C_14 + sms(k,iphyc_14) = ( & + + Cphot * PhyC_14 & + - lossC * limitFacN * PhyC_14 & + - phyRespRate * PhyC_14 & + - aggregationRate * PhyC_14 & + - grazingFlux_phy * recipQuota_14 & + ) * dt_b + sms(k,iphyc_14) +!------------------------------------------------------------------------------- +! Detritus C_14 + sms(k,idetc_14) = ( & + + grazingFlux_phy * recipQuota_14 & + - grazingFlux_phy * recipQuota_14 * grazEff & + + grazingFlux_Dia * recipQuota_dia_14 & + - grazingFlux_Dia * recipQuota_dia_14 * grazEff & + + aggregationRate * phyC_14 & + + aggregationRate * DiaC_14 & + + hetLossFlux * recipQZoo_14 & + - reminC * arrFunc * DetC_14 & + ) * dt_b + sms(k,idetc_14) +!------------------------------------------------------------------------------- +! Heterotrophic C_14 + sms(k,ihetc_14) = ( & + + grazingFlux_phy * recipQuota_14 * grazEff & + + grazingFlux_Dia * recipQuota_dia_14 * grazEff & + - hetLossFlux * recipQZoo_14 & + - lossC_z * HetC_14 & + - hetRespFlux_14 & + ) * dt_b + sms(k,ihetc_14) +!------------------------------------------------------------------------------- +! EOC_14 + sms(k,idoc_14) = ( & + + lossC * limitFacN * phyC_14 & + + lossC_d * limitFacN_dia * DiaC_14 & + + reminC * arrFunc * DetC_14 & + + lossC_z * HetC_14 & + - rho_c1 * arrFunc * EOC_14 & + + LocRiverDOC * r_iorg_14 & + ) * dt_b + sms(k,idoc_14) +!------------------------------------------------------------------------------- +! Diatom C_14 + sms(k,idiac_14) = ( & + + Cphot_dia * DiaC_14 & + - lossC_d * limitFacN_dia * DiaC_14 & + - phyRespRate_dia * DiaC_14 & + - aggregationRate * DiaC_14 & + - grazingFlux_dia * recipQuota_dia_14 & + ) * dt_b + sms(k,idiac_14) +!------------------------------------------------------------------------------- +! Small phytoplankton calcite_14 + sms(k,iphycal_14) = ( & + + calcification_14 & + - lossC * limitFacN * phyCalc_14 & + - phyRespRate * phyCalc_14 & + - calc_loss_agg_14 & + - calc_loss_gra_14 & + ) * dt_b + sms(k,iphycal_14) +!------------------------------------------------------------------------------- +! Detritus calcite_14 + sms(k,idetcal_14) = ( & + + lossC * limitFacN * phyCalc_14 & + + phyRespRate * phyCalc_14 & + + calc_loss_agg_14 & + + calc_loss_gra_14 & + - calc_loss_gra_14 * calc_diss_guts & + - calc_diss_14 * DetCalc_14 & + ) * dt_b + sms(k,idetcal_14) +!------------------------------------------------------------------------------- + else +! "Abiotic" DIC_14, identical to DIC except for radioactive decay (-> +! recom_forcing) + sms(k,idic_14) = sms(k,idic) + end if ! ciso_organic_14 + end if ! ciso_14 + end if ! ciso !------------------------------------------------------------------------------- ! Diagnostics: Averaged rates - - recipbiostep = 1.d0/real(biostep) + + recipbiostep = 1.d0/real(biostep) if (Diags) then !*** Net primary production [mmol C /(m3 * day)] vertNPPn(k) = vertNPPn(k) + ( & @@ -2015,13 +2521,17 @@ subroutine REcoM_sms(n,Nn,state,thick,recipthick,SurfSR,sms,Temp, Sali_depth & vertNPPd(k) = vertNPPd(k) + ( & + Cphot_dia * DiaC & - PhyRespRate_dia * DiaC & - ) * recipbiostep + ) * recipbiostep #if defined (__coccos) vertNPPc(k) = vertNPPc(k) + ( & + Cphot_cocco * CoccoC & - PhyRespRate_cocco * CoccoC & ) * recipbiostep + vertNPPp(k) = vertNPPp(k) + ( & + + Cphot_phaeo * PhaeoC & + - PhyRespRate_phaeo * PhaeoC & + ) * recipbiostep #endif !*** Gross primary production [mmol C /(m3 * day)] @@ -2031,12 +2541,15 @@ subroutine REcoM_sms(n,Nn,state,thick,recipthick,SurfSR,sms,Temp, Sali_depth & vertGPPd(k) = vertGPPd(k) + ( & + Cphot_dia * DiaC & - ) * recipbiostep + ) * recipbiostep #if defined (__coccos) vertGPPc(k) = vertGPPc(k) + ( & + Cphot_cocco * CoccoC & ) * recipbiostep + vertGPPp(k) = vertGPPp(k) + ( & + + Cphot_phaeo * PhaeoC & + ) * recipbiostep #endif !*** Net N-assimilation [mmol N/(m3 * day)] @@ -2048,13 +2561,17 @@ subroutine REcoM_sms(n,Nn,state,thick,recipthick,SurfSR,sms,Temp, Sali_depth & vertNNAd(k) = vertNNAd(k) + ( & + N_assim_dia * DiaC & - lossN * limitFacN_dia * DiaN & - ) * recipbiostep + ) * recipbiostep #if defined (__coccos) vertNNAc(k) = vertNNAc(k) + ( & + N_assim_cocco * CoccoC & - lossN * limitFacN_cocco * CoccoN & ) * recipbiostep + vertNNAp(k) = vertNNAp(k) + ( & + + N_assim_phaeo * PhaeoC & + - lossN * limitFacN_phaeo * PhaeoN & + ) * recipbiostep #endif !*** Changed to chlorophyll degradation (commented out gross N-assimilation below) @@ -2070,6 +2587,9 @@ subroutine REcoM_sms(n,Nn,state,thick,recipthick,SurfSR,sms,Temp, Sali_depth & vertChldegc(k) = vertChldegc(k) + ( & + KOchl_cocco & ) * recipbiostep + vertChldegp(k) = vertChldegp(k) + ( & + + KOchl_phaeo & + ) * recipbiostep #endif !*** zooplankton1 respiration @@ -2107,6 +2627,10 @@ subroutine REcoM_sms(n,Nn,state,thick,recipthick,SurfSR,sms,Temp, Sali_depth & vertaggc(k) = vertaggc(k) + ( & + aggregationrate * CoccoC & ) * recipbiostep +!*** aggregation by phaeocystis + vertaggp(k) = vertaggp(k) + ( & + + aggregationrate * PhaeoC & + ) * recipbiostep #endif !*** excrection of DOC by phytoplankton @@ -2124,6 +2648,10 @@ subroutine REcoM_sms(n,Nn,state,thick,recipthick,SurfSR,sms,Temp, Sali_depth & vertdocexc(k) = vertdocexc(k) + ( & + lossC_c * limitFacN_cocco * CoccoC & ) * recipbiostep +!*** excretion of DOC by phaeocystis + vertdocexp(k) = vertdocexp(k) + ( & + + lossC_p * limitFacN_phaeo * PhaeoC & + ) * recipbiostep #endif !*** calcification @@ -2139,20 +2667,30 @@ subroutine REcoM_sms(n,Nn,state,thick,recipthick,SurfSR,sms,Temp, Sali_depth & ! dia respiration vertrespd(k) = vertrespd(k) + ( & + PhyRespRate_dia * DiaC & - ) * recipbiostep + ) * recipbiostep #if defined (__coccos) ! cocco resipration vertrespc(k) = vertrespc(k) + ( & + PhyRespRate_cocco * CoccoC & ) * recipbiostep - +! phaeo resipration + vertrespp(k) = vertrespp(k) + ( & + + PhyRespRate_phaeo * PhaeoC & + ) * recipbiostep #endif endif end do ! Main vertikal loop ends !------------------------------------------------------------------------------- ! Remineralization from the sediments into the bottom layer + + if (use_MEDUSA .and. (sedflx_num .ne. 0)) then + if (mype==0) then !OG + write(*,*) ' --> Sedimentary input of nutrients through MEDUSA' + endif + + else ! not use_MEDUSA or sedflx_num = 0 !*** DIN *** !< decayRateBenN: Remineralization rate for benthic N [day^-1] !< LocBenthos(1): Vertically integrated N concentration in benthos (1 layer) [mmolN/m^2] @@ -2175,6 +2713,29 @@ subroutine REcoM_sms(n,Nn,state,thick,recipthick,SurfSR,sms,Temp, Sali_depth & decayBenthos(4) = calc_diss_ben * LocBenthos(4) ! NEW DISS changed calc_diss to calc_diss_ben to not make the dissolution omega dependent when using the switch OmegaC_diss LocBenthos(4) = LocBenthos(4) - decayBenthos(4) * dt_b + if (ciso) then +!*** DIC_13 *** We ignore isotopic fractionation during remineralization. + decayBenthos(5) = alpha_dcal_13 * decayRateBenC * LocBenthos(5) + LocBenthos(5) = LocBenthos(5) - decayBenthos(5) * dt_b +!*** Calc: DIC_13 *** + decayBenthos(6) = calc_diss_13 * LocBenthos(6) + LocBenthos(6) = LocBenthos(6) - decayBenthos(6) * dt_b ! / depth of benthos + if (ciso_14) then + if (ciso_organic_14) then +!*** DIC_14 *** We ignore isotopic fractionation during remineralization. + decayBenthos(7) = alpha_dcal_14 * decayRateBenC * LocBenthos(7) + LocBenthos(7) = LocBenthos(7) - decayBenthos(7) * dt_b +!*** Calc: DIC_14 *** + decayBenthos(8) = calc_diss_14 * LocBenthos(8) + LocBenthos(8) = LocBenthos(8) - decayBenthos(8) * dt_b ! / depth of benthos + else +! Do nothing here because sms(idic_14) is defined as sms(idic) further +! above + end if ! ciso_organic_14 + end if ! ciso_14 + end if ! ciso + endif ! use_MEDUSA + end do ! Main time loop ends @@ -2190,7 +2751,7 @@ function recom_limiter(slope,qa,qb) Real(kind=8) :: recom_limiter Real(kind=8) :: slope, qa, qb Real(kind=8) :: dq - + dq = qa - qb if (REcoM_Geider_limiter) then recom_limiter = max(min( -slope*dq, 1.d0),0.d0) @@ -2259,7 +2820,7 @@ function iron_chemistry(Fe, totalLigand, ligandStabConst) b = ligandstabConst * (Fe - totalLigand) + 1.d0 c = -totalLigand discrim = b*b - 4.d0 * a * c - + if (a .ne. 0.d0 .and. discrim .ge. 0.d0) then ligand = ( -b + sqrt(discrim) ) / (2.d0 * a) FeL = totalLigand - ligand diff --git a/src/io_meandata.F90 b/src/io_meandata.F90 index 40a7046c2..c8acaf0d4 100644 --- a/src/io_meandata.F90 +++ b/src/io_meandata.F90 @@ -649,6 +649,11 @@ subroutine ini_mean_io(ice, dynamics, tracers, partit, mesh) ! output RECOM 2D #if defined(__recom) +CASE ('xCO2atm ') + if (use_REcoM) then + call def_stream(nod2D, myDim_nod2D, 'xCO2atm', 'atmospheric CO2 mass mixing ratio', 'mole fraction', x_co2atm(:), io_list(i)%freq, io_list(i)%unit, io_list(i)%precision, partit, mesh) + end if + CASE ('dpCO2s ') if (use_REcoM) then call def_stream(nod2D, myDim_nod2D, 'dpCO2s', 'Difference of oceanic pCO2 minus atmospheric pCO2', 'uatm', GlodPCO2surf(:), io_list(i)%freq, io_list(i)%unit, io_list(i)%precision, partit, mesh) @@ -703,6 +708,32 @@ subroutine ini_mean_io(ice, dynamics, tracers, partit, mesh) if (use_REcoM) then call def_stream(nod2D, myDim_nod2D, 'benCalc','Benthos calcite','mmol', Benthos(:,4), io_list(i)%freq, io_list(i)%unit, io_list(i)%precision, partit, mesh) end if +! ciso +CASE ('benC_13 ') + if (use_REcoM) then + if (ciso) then + call def_stream(nod2D, myDim_nod2D, 'benC_13','Benthos Carbon-13','mmol/m2', Benthos(:,5), io_list(i)%freq, io_list(i)%unit, io_list(i)%precision, partit, mesh) + end if + end if +CASE ('benC_14 ') + if (use_REcoM) then + if (ciso) then + call def_stream(nod2D, myDim_nod2D, 'benC_14','Benthos Carbon-14','mmol/m2', Benthos(:,6), io_list(i)%freq, io_list(i)%unit, io_list(i)%precision, partit, mesh) + end if + end if +CASE ('benCalc_13') + if (use_REcoM) then + if (ciso) then + call def_stream(nod2D, myDim_nod2D, 'benCalc_13','Benthos calcite-13','mmol/m2', Benthos(:,7), io_list(i)%freq, io_list(i)%unit, io_list(i)%precision, partit, mesh) + end if + end if +CASE ('benCalc_14') + if (use_REcoM) then + if (ciso) then + call def_stream(nod2D, myDim_nod2D, 'benCalc_14','Benthos calcite-14','mmol/m2', Benthos(:,8), io_list(i)%freq, io_list(i)%unit, io_list(i)%precision, partit, mesh) + end if + end if +!ciso CASE ('NPPn ') if (use_REcoM) then call def_stream(nod2D, myDim_nod2D, 'NPPn','Mean NPP nanophytoplankton','mmolC/m2/d', NPPn, io_list(i)%freq, io_list(i)%unit, io_list(i)%precision, partit, mesh) @@ -765,11 +796,35 @@ subroutine ini_mean_io(ice, dynamics, tracers, partit, mesh) if (use_REcoM) then ! call def_stream(nod2D, myDim_nod2D, 'GNAc','Gross N-assimilation coccolithophores','mmolN/(m2*d)', diags2D(:,12), io_list(i)%freq, io_list(i)%unit, io_list(i)%precision, mesh) ! NEW call def_stream(nod2D, myDim_nod2D, 'ChlDegc','Chlorophyll degradation coccolithophores','1/d', Chldegc, io_list(i)%freq, io_list(i)%unit, io_list(i)%precision, partit, mesh) ! NEW + endif + +CASE ('NPPp ') + if (use_REcoM) then +! call def_stream(nod2D, myDim_nod2D, 'NPPp','Mean NPP phaeocystis','mmolC/(m2*d)', diags2D(:,9), io_list(i)%freq, io_list(i)%unit, io_list(i)%precision, mesh) ! NEW + call def_stream(nod2D, myDim_nod2D, 'NPPp','Mean NPP phaeocystis','mmolC/(m2*d)', NPPp, io_list(i)%freq, io_list(i)%unit, io_list(i)%precision, partit, mesh) ! Phaeocystis + end if + +CASE ('GPPp ') + if (use_REcoM) then +! call def_stream(nod2D, myDim_nod2D, 'GPPp','Mean GPP phaeocystis','mmolC/(m2*d)', diags2D(:,10), io_list(i)%freq, io_list(i)%unit, io_list(i)%precision, mesh) ! NEW + call def_stream(nod2D, myDim_nod2D, 'GPPp','Mean GPP phaeocystis','mmolC/(m2*d)', GPPp, io_list(i)%freq, io_list(i)%unit, io_list(i)%precision, partit, mesh) ! Phaeocystis + end if + +CASE ('NNAp ') + if (use_REcoM) then +! call def_stream(nod2D, myDim_nod2D, 'NNAp','Net N-assimilation phaeocystis','mmolN/(m2*d)', diags2D(:,11), io_list(i)%freq, io_list(i)%unit, io_list(i)%precision, mesh) ! NEW + call def_stream(nod2D, myDim_nod2D, 'NNAp','Net N-assimilation phaeocystis','mmolN/(m2*d)', NNAp, io_list(i)%freq, io_list(i)%unit, io_list(i)%precision, partit, mesh) ! Phaeocystis + endif + +CASE ('Chldegp ') + if (use_REcoM) then +! call def_stream(nod2D, myDim_nod2D, 'GNAp','Gross N-assimilation phaeocystis','mmolN/(m2*d)', diags2D(:,12), io_list(i)%freq, io_list(i)%unit, io_list(i)%precision, mesh) ! NEW + call def_stream(nod2D, myDim_nod2D, 'ChlDegp','Chlorophyll degradation phaeocystis','1/d', Chldegp, io_list(i)%freq, io_list(i)%unit, io_list(i)%precision, partit, mesh) ! Phaeocystis endif #endif !___________________________________________________________________________________________________________________________________ -!>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> 3D streams <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< +! 3D streams !___________________________________________________________________________________________________________________________________ CASE ('temp ') call def_stream((/nl-1, nod2D/), (/nl-1, myDim_nod2D/), 'temp', 'temperature', 'C', tracers%data(1)%values(:,:), io_list(i)%freq, io_list(i)%unit, io_list(i)%precision, partit, mesh) @@ -782,6 +837,10 @@ subroutine ini_mean_io(ice, dynamics, tracers, partit, mesh) if (use_REcoM) then call def_stream((/nl-1, nod2D/), (/nl-1, myDim_nod2D/), 'PAR', 'PAR', 'W/m2', PAR3D(:,:), io_list(i)%freq, io_list(i)%unit, io_list(i)%precision, partit, mesh) end if +CASE ('wsink_det1') + call def_stream((/nl, nod2D/), (/nl, myDim_nod2D/), 'wsink_det1', 'sinking speed of particles in class 1', 'm s-1', Sinkingvel1(:,:), io_list(i)%freq, io_list(i)%unit, io_list(i)%precision, partit, mesh) +CASE ('wsink_det2') + call def_stream((/nl, nod2D/), (/nl, myDim_nod2D/), 'wsink_det2', 'sinking speed of particles in class 2', 'm s-1', Sinkingvel2(:,:), io_list(i)%freq, io_list(i)%unit, io_list(i)%precision, partit, mesh) CASE ('respmeso ') if (use_REcoM) then @@ -823,6 +882,11 @@ subroutine ini_mean_io(ice, dynamics, tracers, partit, mesh) call def_stream((/nl-1, nod2D/), (/nl-1, myDim_nod2D/), 'aggc','Aggregation of coccolithophores', 'mmolC/m2/d', aggc(:,:), io_list(i)%freq, io_list(i)%unit, io_list(i)%precision, partit, mesh) endif +CASE ('aggp ') + if (use_REcoM) then + call def_stream((/nl-1, nod2D/), (/nl-1, myDim_nod2D/), 'aggp','Aggregation of phaeocystis', 'mmolC/(m2*d)', aggp(:,:), io_list(i)%freq, io_list(i)%unit, io_list(i)%precision, partit, mesh) ! Phaeocystis + endif + CASE ('docexn ') if (use_REcoM) then call def_stream((/nl-1, nod2D/), (/nl-1, myDim_nod2D/), 'docexn','DOC excretion by small phytoplankton', 'mmolC/m2/d', docexn(:,:), io_list(i)%freq, io_list(i)%unit, io_list(i)%precision, partit, mesh) @@ -838,6 +902,11 @@ subroutine ini_mean_io(ice, dynamics, tracers, partit, mesh) call def_stream((/nl-1, nod2D/), (/nl-1, myDim_nod2D/), 'docexc','DOC excretion by coccolithophores', 'mmolC/m2/d', docexc(:,:), io_list(i)%freq, io_list(i)%unit, io_list(i)%precision, partit, mesh) endif +CASE ('docexp ') + if (use_REcoM) then + call def_stream((/nl-1, nod2D/), (/nl-1, myDim_nod2D/), 'docexp','DOC excretion by phaeocystis', 'mmolC/(m2*d)', docexp(:,:), io_list(i)%freq, io_list(i)%unit, io_list(i)%precision, partit, mesh) ! Phaeocystis + endif + CASE ('respn ') if (use_REcoM) then call def_stream((/nl-1, nod2D/), (/nl-1, myDim_nod2D/), 'respn','Respiration by small phytoplankton', 'mmolC/m2/d', respn(:,:), io_list(i)%freq, io_list(i)%unit, io_list(i)%precision, partit, mesh) @@ -853,6 +922,11 @@ subroutine ini_mean_io(ice, dynamics, tracers, partit, mesh) call def_stream((/nl-1, nod2D/), (/nl-1, myDim_nod2D/), 'respc','Respiration by coccolithophores', 'mmolC/(m2*d)', respc(:,:), io_list(i)%freq, io_list(i)%unit, io_list(i)%precision, partit, mesh) endif +CASE ('respp ') + if (use_REcoM) then + call def_stream((/nl-1, nod2D/), (/nl-1, myDim_nod2D/), 'respp','Respiration by phaeocystis', 'mmolC/(m2*d)', respp(:,:), io_list(i)%freq, io_list(i)%unit, io_list(i)%precision, partit, mesh) ! Phaeocystis + endif + CASE ('NPPn3D ') if (use_REcoM) then call def_stream((/nl-1, nod2D/), (/nl-1, myDim_nod2D/), 'NPPn3D','Net primary production of small phytoplankton', 'mmolC/m2/d', NPPn3D(:,:), io_list(i)%freq, io_list(i)%unit, io_list(i)%precision, partit, mesh) @@ -867,6 +941,117 @@ subroutine ini_mean_io(ice, dynamics, tracers, partit, mesh) if (use_REcoM) then call def_stream((/nl-1, nod2D/), (/nl-1, myDim_nod2D/), 'NPPc3D','Net primary production of coccolithophores', 'mmolC/m2/d', NPPc3D(:,:), io_list(i)%freq, io_list(i)%unit, io_list(i)%precision, partit, mesh) endif + +CASE ('NPPp3D ') + if (use_REcoM) then + call def_stream((/nl-1, nod2D/), (/nl-1, myDim_nod2D/), 'NPPp3D','Net primary production of phaeocystis', 'mmolC/(m2*d)', NPPp3D(:,:), io_list(i)%freq, io_list(i)%unit, io_list(i)%precision, partit, mesh) ! Phaeocystis + endif + +CASE ('TTemp_diatoms ') + if (use_REcoM) then + call def_stream((/nl-1, nod2D/), (/nl-1, myDim_nod2D/), 'TTemp_diatoms','Temperature dependence of diatoms PS', 'per day',TTemp_diatoms(:,:), io_list(i)%freq, io_list(i)%unit, io_list(i)%precision, partit, mesh) + endif + +CASE ('TTemp_phyto ') + if (use_REcoM) then + call def_stream((/nl-1, nod2D/), (/nl-1, myDim_nod2D/), 'TTemp_phyto','Temperature dependence of small phytoplankton PS', 'per day',TTemp_phyto(:,:), io_list(i)%freq, io_list(i)%unit, io_list(i)%precision, partit, mesh) + endif + +CASE ('TTemp_cocco ') + if (use_REcoM) then + call def_stream((/nl-1, nod2D/), (/nl-1, myDim_nod2D/), 'TTemp_cocco','Temperature dependence of coccolithophores PS', 'per day',TTemp_cocco(:,:), io_list(i)%freq, io_list(i)%unit, io_list(i)%precision, partit, mesh) + endif + +CASE ('TTemp_phaeo ') + if (use_REcoM) then + call def_stream((/nl-1, nod2D/), (/nl-1, myDim_nod2D/), 'TTemp_phaeo','Temperature dependence of phaeocystis PS', 'per day',TTemp_phaeo(:,:), io_list(i)%freq, io_list(i)%unit, io_list(i)%precision, partit, mesh) + endif + +CASE ('TPhyCO2 ') + if (use_REcoM) then + call def_stream((/nl-1, nod2D/), (/nl-1, myDim_nod2D/), 'TPhyCO2','Effect of CO2 of phyto growth/PS', 'per day',TPhyCO2(:,:), io_list(i)%freq, io_list(i)%unit, io_list(i)%precision, partit, mesh) + endif + +CASE ('TDiaCO2 ') + if (use_REcoM) then + call def_stream((/nl-1, nod2D/), (/nl-1, myDim_nod2D/), 'TDiaCO2','Effect of CO2 of phyto growth/PS', 'per day',TDiaCO2(:,:), io_list(i)%freq, io_list(i)%unit, io_list(i)%precision, partit, mesh) + endif + +CASE ('TCoccoCO2 ') + if (use_REcoM) then + call def_stream((/nl-1, nod2D/), (/nl-1, myDim_nod2D/), 'TCoccoCO2','Effect of CO2 of phyto growth/PS', 'per day',TCoccoCO2(:,:), io_list(i)%freq, io_list(i)%unit, io_list(i)%precision, partit, mesh) + endif + +CASE ('TPhaeoCO2 ') + if (use_REcoM) then + call def_stream((/nl-1, nod2D/), (/nl-1, myDim_nod2D/), 'TPhaeoCO2','Effect of CO2 of phyto growth/PS', 'per day',TPhaeoCO2(:,:), io_list(i)%freq, io_list(i)%unit, io_list(i)%precision, partit, mesh) + endif + +CASE ('TqLF_phyto ') + if (use_REcoM) then + call def_stream((/nl-1, nod2D/), (/nl-1, myDim_nod2D/), 'TqLF_phyto','Nutrient limitation effect of phyto PS', 'per day',TqlimitFac_phyto(:,:), io_list(i)%freq, io_list(i)%unit, io_list(i)%precision, partit, mesh) + endif + +CASE ('TqLF_diatoms ') + if (use_REcoM) then + call def_stream((/nl-1, nod2D/), (/nl-1, myDim_nod2D/), 'TqLF_diatoms','Nutrient limitation effect of diatoms PS', 'per day',TqlimitFac_diatoms(:,:), io_list(i)%freq, io_list(i)%unit, io_list(i)%precision, partit, mesh) + endif + +CASE ('TqLF_cocco ') + if (use_REcoM) then + call def_stream((/nl-1, nod2D/), (/nl-1, myDim_nod2D/), 'TqLF_cocco','Nutrient limitation effect of diatoms PS', 'per day',TqlimitFac_cocco(:,:), io_list(i)%freq, io_list(i)%unit, io_list(i)%precision, partit, mesh) + endif + +CASE ('TqLF_phaeo ') + if (use_REcoM) then + call def_stream((/nl-1, nod2D/), (/nl-1, myDim_nod2D/), 'TqLF_phaeo','Nutrient limitation effect of diatoms PS', 'per day', TqlimitFac_phaeo(:,:), io_list(i)%freq, io_list(i)%unit, io_list(i)%precision, partit, mesh) + endif + +CASE ('TCphotLL_phyto ') + if (use_REcoM) then + call def_stream((/nl-1, nod2D/), (/nl-1, myDim_nod2D/), 'TCphotLL_phyto','Light limitation on phyto PS', 'per day', TCphotLigLim_phyto(:,:), io_list(i)%freq, io_list(i)%unit, io_list(i)%precision, partit, mesh) + endif + +CASE ('TCphotLL_dia ') + if (use_REcoM) then + call def_stream((/nl-1, nod2D/), (/nl-1, myDim_nod2D/), 'TCphotLL_dia','Light limitation on diatoms PS', 'per day', TCphotLigLim_diatoms(:,:), io_list(i)%freq, io_list(i)%unit, io_list(i)%precision, partit, mesh) + endif + +CASE ('TCphotLL_cocco ') + if (use_REcoM) then + call def_stream((/nl-1, nod2D/), (/nl-1, myDim_nod2D/), 'TCphotLL_cocco','Light limitation on phyto PS', 'per day',TCphotLigLim_cocco(:,:), io_list(i)%freq, io_list(i)%unit, io_list(i)%precision, partit, mesh) + endif + +CASE ('TCphotLL_phaeo ') + if (use_REcoM) then + call def_stream((/nl-1, nod2D/), (/nl-1, myDim_nod2D/), 'TCphotLL_phaeo','Light limitation on phyto PS', 'per day',TCphotLigLim_phaeo(:,:), io_list(i)%freq, io_list(i)%unit, io_list(i)%precision, partit, mesh) + endif + +CASE ('TCphot_phyto ') + if (use_REcoM) then + call def_stream((/nl-1, nod2D/), (/nl-1, myDim_nod2D/), 'TCphot_phyto','Light limitation on phyto PS', 'per day',TCphot_phyto(:,:), io_list(i)%freq, io_list(i)%unit, io_list(i)%precision, partit, mesh) + endif + +CASE ('TCphot_diatoms ') + if (use_REcoM) then + call def_stream((/nl-1, nod2D/), (/nl-1, myDim_nod2D/), 'TCphot_diatoms','Light limitation on phyto PS', 'per day',TCphot_diatoms(:,:), io_list(i)%freq, io_list(i)%unit, io_list(i)%precision, partit, mesh) + endif + +CASE ('TCphot_cocco ') + if (use_REcoM) then + call def_stream((/nl-1, nod2D/), (/nl-1, myDim_nod2D/), 'TCphot_cocco','Light limitation on phyto PS', 'per day',TCphot_cocco(:,:), io_list(i)%freq, io_list(i)%unit, io_list(i)%precision, partit, mesh) + endif + +CASE ('TCphot_phaeo ') + if (use_REcoM) then + call def_stream((/nl-1, nod2D/), (/nl-1, myDim_nod2D/), 'TCphot_phaeo','Light limitation on phyto PS', 'per day',TCphot_phaeo(:,:), io_list(i)%freq, io_list(i)%unit, io_list(i)%precision, partit, mesh) + endif + +CASE ('TSi_assimDia ') + if (use_REcoM) then + call def_stream((/nl-1, nod2D/), (/nl-1, myDim_nod2D/), 'TSi_assimDia','Silicate assimilation', 'per day',TSi_assimDia(:,:), io_list(i)%freq, io_list(i)%unit, io_list(i)%precision, partit, mesh) + endif + #endif !CASE ('otracers ') @@ -884,9 +1069,35 @@ subroutine ini_mean_io(ice, dynamics, tracers, partit, mesh) call def_stream((/nl-1, nod2D/), (/nl-1, myDim_nod2D/), 'DIN', 'Dissolved Inorganic Nitrogen', '[mmol/m3]', tracers%data(j)%values(:,:), io_list(i)%freq, io_list(i)%unit, io_list(i)%precision, partit, mesh) endif - else if (tracers%data(j)%ID==1002) then + else if (tracers%data(j)%ID==1002) then ! NOTE Divide tracers%work%tra_advvert(:,:,j) by dt if (use_REcoM) then call def_stream((/nl-1, nod2D/), (/nl-1, myDim_nod2D/), 'DIC', 'Dissolved Inorganic C', '[mmol/m3]', tracers%data(j)%values(:,:), io_list(i)%freq, io_list(i)%unit, io_list(i)%precision, partit, mesh) + + if (tracers%data(j)%ltra_diag) then ! OG - tra_diag + ! horizontal advection + call def_stream((/nl-1, nod2D/), (/nl-1, myDim_nod2D/), 'DIC_hor_adv', 'Horizontal advection part of dissolved Inorganic C', '[mmol/m3/s]', tracers%work%tra_advhoriz(:,:,j), io_list(i)%freq, io_list(i)%unit, io_list(i)%precision, partit, mesh) + + ! vertical advection + call def_stream((/nl-1, nod2D/), (/nl-1, myDim_nod2D/), 'DIC_ver_adv', 'Vertical advection part of dissolved Inorganic C', '[mmol/m3/s]', tracers%work%tra_advvert(:,:,j), io_list(i)%freq, io_list(i)%unit, io_list(i)%precision, partit, mesh) + + ! horizontal diffusion + call def_stream((/nl-1, nod2D/), (/nl-1, myDim_nod2D/), 'DIC_tra_diff_part_hor_redi', 'Horizontal diffusion of dissolved Inorganic C (includes Redi diffusivity if Redi=.true.)', '[mmol/m3/s]', tracers%work%tra_diff_part_hor_redi(:,:,j), io_list(i)%freq, io_list(i)%unit, io_list(i)%precision, partit, mesh) + + if (.not. tracers%data(j)%i_vert_diff) then + ! vertical diffusion (Explicit) + call def_stream((/nl-1, nod2D/), (/nl-1, myDim_nod2D/), 'DIC_tra_diff_part_ver_expl', 'Vertical diffusion of dissolved Inorganic C (Explicit)', '[mmol/m3/s]', tracers%work%tra_diff_part_ver_expl(:,:,j), io_list(i)%freq, io_list(i)%unit, io_list(i)%precision, partit, mesh) + end if + + ! projection of horizontal Redi diffussivity onto vertical + call def_stream((/nl-1, nod2D/), (/nl-1, myDim_nod2D/), 'DIC_tra_diff_part_ver_redi_expl', 'Projection of horizontal Redi diffussivity onto vertical for dissolved Inorganic C (Explicit)', '[mmol/m3/s]', tracers%work%tra_diff_part_ver_redi_expl(:,:,j), io_list(i)%freq, io_list(i)%unit, io_list(i)%precision, partit, mesh) + + ! vertical diffusion (Implicit) + call def_stream((/nl-1, nod2D/), (/nl-1, myDim_nod2D/), 'DIC_tra_diff_part_ver_impl', 'Vertical diffusion of dissolved Inorganic C (Implicit)', '[mmol/m3/s]', tracers%work%tra_diff_part_ver_impl(:,:,j), io_list(i)%freq, io_list(i)%unit, io_list(i)%precision, partit, mesh) + + ! recom_sms + call def_stream((/nl-1, nod2D/), (/nl-1, myDim_nod2D/), 'DIC_recom_sms', 'Recom SMS', '[mmol/m3/s]', tracers%work%tra_recom_sms(:,:,j), io_list(i)%freq, io_list(i)%unit, io_list(i)%precision, partit, mesh) + end if + endif else if (tracers%data(j)%ID==1003) then @@ -1036,10 +1247,25 @@ subroutine ini_mean_io(ice, dynamics, tracers, partit, mesh) else if (tracers%data(j)%ID==1032) then if (use_REcoM) then - call def_stream((/nl-1, nod2D/), (/nl-1, myDim_nod2D/), 'Zoo3N', 'Zoo3N', '[mmol/m3]', tracers%data(j)%values(:,:), io_list(i)%freq, io_list(i)%unit, io_list(i)%precision, partit, mesh) + call def_stream((/nl-1, nod2D/), (/nl-1, myDim_nod2D/), 'PhaeoN', 'PhaeoN', '[mmol/m3]', tracers%data(j)%values(:,:), io_list(i)%freq, io_list(i)%unit, io_list(i)%precision, partit, mesh) ! NEW endif else if (tracers%data(j)%ID==1033) then + if (use_REcoM) then + call def_stream((/nl-1, nod2D/), (/nl-1, myDim_nod2D/), 'PhaeoC', 'PhaeoC', '[mmol/m3]', tracers%data(j)%values(:,:), io_list(i)%freq, io_list(i)%unit, io_list(i)%precision, partit, mesh) ! NEW + endif + + else if (tracers%data(j)%ID==1034) then + if (use_REcoM) then + call def_stream((/nl-1, nod2D/), (/nl-1, myDim_nod2D/), 'PhaeoChl', 'PhaeoChl', '[mg/m3]', tracers%data(j)%values(:,:), io_list(i)%freq, io_list(i)%unit, io_list(i)%precision, partit, mesh) ! NEW + endif + + else if (tracers%data(j)%ID==1035) then + if (use_REcoM) then + call def_stream((/nl-1, nod2D/), (/nl-1, myDim_nod2D/), 'Zoo3N', 'Zoo3N', '[mmol/m3]', tracers%data(j)%values(:,:), io_list(i)%freq, io_list(i)%unit, io_list(i)%precision, partit, mesh) + endif + + else if (tracers%data(j)%ID==1036) then if (use_REcoM) then call def_stream((/nl-1, nod2D/), (/nl-1, myDim_nod2D/), 'Zoo3C', 'Zoo3C', '[mmol/m3]', tracers%data(j)%values(:,:), io_list(i)%freq, io_list(i)%unit, io_list(i)%precision, partit, mesh) endif diff --git a/src/io_restart.F90 b/src/io_restart.F90 index b7707d087..4c1577a21 100644 --- a/src/io_restart.F90 +++ b/src/io_restart.F90 @@ -297,6 +297,24 @@ subroutine ini_bio_io(tracers, partit, mesh) call bio_files%def_node_var('BenSi', 'Benthos Silicate', 'mmol/m3', Benthos(:,3), mesh, partit); call bio_files%def_node_var('BenCalc', 'Benthos Calcite', 'mmol/m3', Benthos(:,4), mesh, partit); call bio_files%def_node_var('HPlus', 'Conc. of H-plus ions in the surface water', 'mol/kg', GloHplus, mesh, partit); + if (ciso) then + call bio_files%def_node_var('BenC_13', 'Benthos Carbon-13', 'mmol/m3', Benthos(:,5), mesh, partit); + call bio_files%def_node_var('BenCalc_13', 'Benthos Calcite-13', 'mmol/m3', Benthos(:,6), mesh, partit); + if (ciso_14 .and. ciso_organic_14) then + call bio_files%def_node_var('BenC_14', 'Benthos Carbon-14', 'mmol/m3', Benthos(:,7), mesh, partit); + call bio_files%def_node_var('BenCalc_14', 'Benthos Calcite-14', 'mmol/m3', Benthos(:,8), mesh, partit); + end if ! ciso_14 + end if ! ciso + if (use_atbox) then + call bio_files%def_node_var('xCO2', 'Atm. CO2 mixing ratio', 'mol / mol', x_co2atm(:), mesh, partit); + if (ciso) then + call bio_files%def_node_var('xCO2_13', 'Atm. 13CO2 mixing ratio', 'mol / mol', x_co2atm_13(:), mesh, partit); + if (ciso_14) then + call bio_files%def_node_var('xCO2_14', 'Atm. 14CO2 mixing ratio', 'mol / mol', x_co2atm_14(:), mesh, partit); + call bio_files%def_node_var('cosmic_14', 'Cosmic 14C production', 'mol / s', cosmic_14(:), mesh, partit); + end if + end if + end if ! use_atbox end subroutine ini_bio_io #endif diff --git a/src/io_restart_file_group.F90 b/src/io_restart_file_group.F90 index 31c9263f5..b69e11d95 100644 --- a/src/io_restart_file_group.F90 +++ b/src/io_restart_file_group.F90 @@ -17,7 +17,7 @@ module restart_file_group_module type restart_file_group private - type(restart_file_type), public :: files(112) + type(restart_file_type), public :: files(200) ! .OG. 112 Before integer, public :: nfiles = 0 ! todo: allow dynamically allocated size without messing with shallow copied pointers contains diff --git a/src/oce_adv_tra_driver.F90 b/src/oce_adv_tra_driver.F90 index 9b9606ea8..fa0cd7c65 100644 --- a/src/oce_adv_tra_driver.F90 +++ b/src/oce_adv_tra_driver.F90 @@ -209,6 +209,27 @@ subroutine do_oce_adv_tra(dt, vel, w, wi, we, tr_num, dynamics, tracers, partit, #endif #endif + +! O:G - tra_diag +! LO solution +! fct_LO is zero before adv_flux_hor +! Up to now only horizontal +! contribution + + +!#if defined (__recom) + if (tracers%data(tr_num)%ltra_diag) then + do n=1, myDim_nod2D+eDim_nod2D + nu1 = ulevels_nod2D(n) + nl1 = nlevels_nod2D(n) + do nz = nu1, nl1-1 + ! Horizontal advection part for LO (FCT is .TRUE.) + tracers%work%tra_advhoriz(nz,n,tr_num) = fct_LO(nz,n) * dt/areasvol(nz,n)/hnode_new(nz,n) + end do + end do + end if +!#endif + ! compute the low order upwind vertical flux (explicit part only) ! zero the input/output flux before computation call adv_tra_ver_upw1(we, ttf, partit, mesh, adv_flux_ver, o_init_zero=.true.) @@ -277,6 +298,24 @@ subroutine do_oce_adv_tra(dt, vel, w, wi, we, tr_num, dynamics, tracers, partit, end if +! O:G - tra_diag +! LO solution +! fct_LO is zero before adv_flux_ver +! vertical contribution + +!#if defined (__recom) + if (tracers%data(tr_num)%ltra_diag) then + do n=1, myDim_nod2D+eDim_nod2D + nu1 = ulevels_nod2D(n) + nl1 = nlevels_nod2D(n) + do nz = nu1, nl1-1 + ! Vertical advection part for LO (FCT is .TRUE.) + tracers%work%tra_advvert (nz,n,tr_num) = (adv_flux_ver(nz, n)-adv_flux_ver(nz+1, n))*dt/areasvol(nz,n)/hnode_new(nz,n) + end do + end do + end if +!#endif + !_______________________________________________________________________ if (dynamics%use_wsplit) then !wvel/=wvel_e @@ -301,7 +340,7 @@ subroutine do_oce_adv_tra(dt, vel, w, wi, we, tr_num, dynamics, tracers, partit, ! do horizontal tracer advection, in case of FCT high order solution SELECT CASE(trim(tracers%data(tr_num)%tra_adv_hor)) CASE('MUSCL') - ! compute the untidiffusive horizontal flux (o_init_zero=.false.: input is the LO horizontal flux computed above) + ! compute the antidiffusive horizontal flux (o_init_zero=.false.: input is the LO horizontal flux computed above) call adv_tra_hor_muscl(vel, ttfAB, partit, mesh, opth, adv_flux_hor, edge_up_dn_grad, nboundary_lay, o_init_zero=do_zero_flux) CASE('MFCT') call adv_tra_hor_mfct(vel, ttfAB, partit, mesh, opth, adv_flux_hor, edge_up_dn_grad, o_init_zero=do_zero_flux) @@ -416,6 +455,36 @@ subroutine do_oce_adv_tra(dt, vel, w, wi, we, tr_num, dynamics, tracers, partit, end if end if !-->if ((ldiag_DVD) .and. (tr_num<=2)) then + + +! O:G - tra_diag +!#if defined (__recom) + if (tracers%data(tr_num)%ltra_diag) then + !_______________________________________________________________________ + if (trim(tracers%data(tr_num)%tra_adv_lim)=='FCT') then + do n=1, myDim_nod2D+eDim_nod2D + nu1 = ulevels_nod2D(n) + nl1 = nlevels_nod2D(n) + do nz = nu1, nl1-1 + ! part for LO + antidiffusive (FCT is .TRUE.) + tracers%work%tra_advhoriz(nz,n,tr_num) = tracers%work%tra_advhoriz(nz,n,tr_num) + dttf_h(nz,n)/hnode_new(nz,n) + tracers%work%tra_advvert(nz,n,tr_num) = tracers%work%tra_advvert(nz,n,tr_num) + dttf_v(nz,n)/hnode_new(nz,n) + end do + end do + else + do n=1, myDim_nod2D+eDim_nod2D + nu1 = ulevels_nod2D(n) + nl1 = nlevels_nod2D(n) + do nz = nu1, nl1-1 + ! (FCT .FALSE.) + tracers%work%tra_advhoriz(nz,n,tr_num) = dttf_h(nz,n)/hnode_new(nz,n) + tracers%work%tra_advvert (nz,n,tr_num) = dttf_v(nz,n)/hnode_new(nz,n) + end do + end do + end if + end if +!#endif + end subroutine do_oce_adv_tra ! ! diff --git a/src/oce_ale.F90 b/src/oce_ale.F90 index b86c7a87f..429aeddcd 100644 --- a/src/oce_ale.F90 +++ b/src/oce_ale.F90 @@ -3342,6 +3342,7 @@ subroutine oce_timestep_ale(n, ice, dynamics, tracers, partit, mesh) use solve_tracers_ale_interface use write_step_info_interface use check_blowup_interface + use ieee_arithmetic use fer_solve_interface use impl_vert_visc_ale_vtransp_interface #if defined (FESOM_PROFILING) @@ -3359,6 +3360,7 @@ subroutine oce_timestep_ale(n, ice, dynamics, tracers, partit, mesh) real(kind=8) :: t0,t1, t2, t30, t3, t4, t5, t6, t7, t8, t9, t10, loc, glo integer :: node integer :: nz, elem, nzmin, nzmax !for KE diagnostic + integer :: tr_num ! for cavity NaN cleanup !___________________________________________________________________________ ! pointer on necessary derived types real(kind=WP), dimension(:), pointer :: eta_n @@ -3795,6 +3797,22 @@ subroutine oce_timestep_ale(n, ice, dynamics, tracers, partit, mesh) call fesom_profiler_end("oce_tracer_solve") call fesom_profiler_start("oce_thickness_update") #endif +#if defined (__recom) + ! CAVITY FIX: Clean up NaN created by tracer advection/diffusion at cavity nodes + ! Cavity nodes can create NaN during numerical operations with zero/near-zero thickness + if (use_cavity) then + do node=1, partit%myDim_nod2D+partit%eDim_nod2D + if (mesh%ulevels_nod2D(node) > 1) then + ! Clean NaN in ALL levels for cavity nodes (not just cavity layers) + do tr_num=1, tracers%num_tracers + where (.not. ieee_is_finite(tracers%data(tr_num)%values(:, node))) + tracers%data(tr_num)%values(:, node) = 0.0_WP + end where + enddo + endif + enddo + endif +#endif !___________________________________________________________________________ ! Update hnode=hnode_new, helem diff --git a/src/oce_ale_tracer.F90 b/src/oce_ale_tracer.F90 index dd4ce9101..dded6ee6a 100644 --- a/src/oce_ale_tracer.F90 +++ b/src/oce_ale_tracer.F90 @@ -165,6 +165,8 @@ subroutine solve_tracers_ale(ice, dynamics, tracers, partit, mesh) type(t_mesh) , intent(in) , target :: mesh !___________________________________________________________________________ integer :: i, tr_num, node, elem, nzmax, nzmin + real(kind=WP) :: ttf_rhs_bak (mesh%nl-1, partit%myDim_nod2D+partit%eDim_elem2D) ! local variable ! OG - tra_diag + integer :: nz, n, nu1, nl1 ! OG - tra_diag !___________________________________________________________________________ ! pointer on necessary derived types real(kind=WP), dimension(:,:,:), pointer :: UV, fer_UV @@ -210,6 +212,14 @@ subroutine solve_tracers_ale(ice, dynamics, tracers, partit, mesh) !$OMP END PARALLEL DO end if + ! Set advective and diffusive components of total tracer fluxes to zero + ! Before tr_num loop +!#if defined (__recom) ! not necessarily should belong to recom case +! tracers%work%tra_advhoriz = 0.0 ! O:G - tra_diag +! tracers%work%tra_advvert = 0.0 + ttf_rhs_bak = 0.0 +!#endif + !___________________________________________________________________________ ! loop over all tracers !$ACC UPDATE DEVICE(dynamics%w, dynamics%w_e, dynamics%uv) !!! async(1) @@ -217,6 +227,14 @@ subroutine solve_tracers_ale(ice, dynamics, tracers, partit, mesh) !$ACC UPDATE DEVICE (mesh%helem, mesh%hnode, mesh%hnode_new, mesh%zbar_3d_n, mesh%z_3d_n) do tr_num=1, tracers%num_tracers +#if defined(__recom) +!YY: sinkflx needs to be reset at each time step + if(use_MEDUSA) then + SinkFlx = 0.0d0 + endif + SinkingVel1 = 0.0d0 ! OG 16.03.23 + SinkingVel2 = 0.0d0 ! OG 16.03.23 +#endif ! do tracer AB (Adams-Bashfort) interpolation only for advectiv part ! needed if (flag_debug .and. mype==0) print *, achar(27)//'[37m'//' --> call init_tracers_AB'//achar(27)//'[0m' @@ -240,16 +258,53 @@ subroutine solve_tracers_ale(ice, dynamics, tracers, partit, mesh) tracers%work%del_ttf(:, node)=tracers%work%del_ttf(:, node)+tracers%work%del_ttf_advhoriz(:, node)+tracers%work%del_ttf_advvert(:, node) end do !$OMP END PARALLEL DO - + +! O:G +! Save horizontal and vertical advective fluxes. +! We have the values on the nodes +! We do not know how much each edge contributes +! to the nodes it connects +! Notes from Patrick: del_ttf includes +! Low-order solution. But, del_ttf_advhoriz and +! del_ttf_advvert contain antidiffusive fluxes +! from the FCT scheme + +!if (.FALSE.) then +! O:G - tra_diag +!#if defined (__recom) +! if (tracers%data(tr_num)%ltra_diag) then +! do n=1, myDim_nod2D+eDim_nod2D +! nu1 = ulevels_nod2D(n) +! nl1 = nlevels_nod2D(n) +! do nz = nu1, nl1-1 + ! Horizontal advection part +! tracers%work%tra_advhoriz(nz,n,tr_num) = tracers%work%del_ttf_advhoriz(nz,n) + ! Vertical advection part +! tracers%work%tra_advvert (nz,n,tr_num) = tracers%work%del_ttf_advvert(nz,n) +! end do +! end do +! end if +!#endif +!endif !___________________________________________________________________________ ! diffuse tracers if (flag_debug .and. mype==0) print *, achar(27)//'[37m'//' --> call diff_tracers_ale'//achar(27)//'[0m' call diff_tracers_ale(tr_num, dynamics, tracers, ice, partit, mesh) + !___________________________________________________________________________ ! Radioactive decay of 14C and 39Ar if (tracers%data(tr_num)%ID == 14) tracers%data(tr_num)%values(:,:) = tracers%data(tr_num)%values(:,:) * exp(-decay14 * dt) if (tracers%data(tr_num)%ID == 39) tracers%data(tr_num)%values(:,:) = tracers%data(tr_num)%values(:,:) * exp(-decay39 * dt) - + +!YY: C14 seems to be calculated both in fesom and recom +!YY: decay differently calculated??? +#if defined(__ciso) + ! radioactive decay of 14C + if (ciso_14 .and. any(c14_tracer_id == tracers%data(tr_num)%ID)) then + tracers%data(tr_num)%values(:,:) = tracers%data(tr_num)%values(:,:) * (1 - lambda_14 * dt) + end if ! ciso & ciso_14 +#endif + !___________________________________________________________________________ ! relax to salt and temp climatology if (flag_debug .and. mype==0) print *, achar(27)//'[37m'//' --> call relax_to_clim'//achar(27)//'[0m' @@ -272,6 +327,17 @@ subroutine solve_tracers_ale(ice, dynamics, tracers, partit, mesh) !!! !$ACC UPDATE HOST (tracers%work%fct_ttf_min, tracers%work%fct_ttf_max, tracers%work%fct_plus, tracers%work%fct_minus) & !!! !$ACC HOST (tracers%work%edge_up_dn_grad) +#if defined(__recom) + do tr_num = 1, tracers%num_tracers + if (use_MEDUSA) then + SinkFlx = SinkFlx + SinkFlx_tr(:, :, tr_num) + endif +! Benthos = Benthos + Benthos_tr(:, :, tr_num) + Sinkingvel1(:,:) = Sinkingvel1(:,:) + Sinkvel1_tr(:, :, tr_num) + Sinkingvel2(:,:) = Sinkingvel2(:,:) + Sinkvel2_tr(:, :, tr_num) + end do +#endif + !___________________________________________________________________________ ! 3D restoring for "passive" tracers !!!$OMPTODO: add OpenMP later, not needed right now! @@ -364,6 +430,8 @@ subroutine diff_tracers_ale(tr_num, dynamics, tracers, ice, partit, mesh) type(t_mesh) , intent(in) , target :: mesh !___________________________________________________________________________ integer :: n, nzmax, nzmin + real(kind=WP) :: ttf_rhs_bak (mesh%nl-1, partit%myDim_nod2D+partit%eDim_nod2D) ! OG - tra_diag + integer :: nz, nu1, nl1 ! OG - tra_diag !___________________________________________________________________________ ! pointer on necessary derived types real(kind=WP), pointer :: del_ttf(:,:) @@ -378,21 +446,90 @@ subroutine diff_tracers_ale(tr_num, dynamics, tracers, ice, partit, mesh) vert_sink = 0.0_WP #endif + ttf_rhs_bak = 0.0 ! OG - tra_diag + + if (tracers%data(tr_num)%ltra_diag) then ! OG - tra_diag + do n=1, myDim_nod2D+eDim_nod2D + nu1 = ulevels_nod2D(n) + nl1 = nlevels_nod2D(n) + do nz = nu1, nl1-1 + ttf_rhs_bak(nz,n) = del_ttf(nz,n) + end do + end do + end if !___________________________________________________________________________ - ! do horizontal diffusiion + ! do horizontal diffusion ! write there also horizontal diffusion rhs to del_ttf which is equal the R_T^n ! in danilovs srcipt ! includes Redi diffusivity if Redi=.true. call diff_part_hor_redi(tracers, partit, mesh) ! seems to be ~9% faster than diff_part_hor - + + if (tracers%data(tr_num)%ltra_diag) then ! OG - tra_diag + do n=1, myDim_nod2D+eDim_nod2D + nu1 = ulevels_nod2D(n) + nl1 = nlevels_nod2D(n) + do nz = nu1, nl1-1 + ! horizontal diffusion (w/out Redi) + tracers%work%tra_diff_part_hor_redi(nz,n,tr_num) = (del_ttf(nz,n) - ttf_rhs_bak(nz,n)) / hnode_new(nz,n) ! Unit [Conc] + !if (mype==0) print *, tracers%work%tra_diff_part_hor_redi(nz,n,tr_num) + end do + end do + end if + + if ((.not. tracers%data(tr_num)%i_vert_diff) .and. tracers%data(tr_num)%ltra_diag) then ! OG - tra_diag + do n=1, myDim_nod2D+eDim_nod2D + nu1 = ulevels_nod2D(n) + nl1 = nlevels_nod2D(n) + do nz = nu1, nl1-1 + ttf_rhs_bak(nz,n) = del_ttf(nz,n) + end do + end do + end if !___________________________________________________________________________ ! do vertical diffusion: explicit if (.not. tracers%data(tr_num)%i_vert_diff) call diff_ver_part_expl_ale(tr_num, tracers, partit, mesh) - + + ! OG i_vert_diff = TRUE so, we dont call explicit scheme + ! If we use this, check surface forcing for recom variables (They are not updated) + if ((.not. tracers%data(tr_num)%i_vert_diff) .and. tracers%data(tr_num)%ltra_diag) then ! OG - tra_diag + do n=1, myDim_nod2D+eDim_nod2D + nu1 = ulevels_nod2D(n) + nl1 = nlevels_nod2D(n) + do nz = nu1, nl1-1 + ! vertical diffusion: explicit + tracers%work%tra_diff_part_ver_expl(nz,n,tr_num) = (del_ttf(nz,n) - ttf_rhs_bak(nz,n)) / hnode_new(nz,n) ! Unit [Conc] + !if (mype==0) print *, tra_diff_part_ver_expl(:,:,tr_num) + end do + end do + end if + ! A projection of horizontal Redi diffussivity onto vertical. This par contains horizontal ! derivatives and has to be computed explicitly! + + if (tracers%data(tr_num)%ltra_diag .and. Redi) then ! OG - tra_diag + do n=1, myDim_nod2D+eDim_nod2D + nu1 = ulevels_nod2D(n) + nl1 = nlevels_nod2D(n) + do nz = nu1, nl1-1 + ttf_rhs_bak(nz,n) = del_ttf(nz,n) + end do + end do + end if + if (Redi) call diff_ver_part_redi_expl(tracers, partit, mesh) + if (tracers%data(tr_num)%ltra_diag .and. Redi) then ! OG - tra_diag + do n=1, myDim_nod2D+eDim_nod2D + nu1 = ulevels_nod2D(n) + nl1 = nlevels_nod2D(n) + do nz = nu1, nl1-1 + ! Redi diffussivity onto vertical: explicit + tracers%work%tra_diff_part_ver_redi_expl(nz,n,tr_num) = (del_ttf(nz,n) - ttf_rhs_bak(nz,n)) / hnode_new(nz,n) ! Unit [Conc] + !if (mype==0) print *, tra_diff_part_ver_redi_expl(:,:,tr_num) + end do + end do + end if + ! if (recom_debug .and. mype==0) print *, tracers%data(tr_num)%ID #if defined(__recom) @@ -479,7 +616,32 @@ subroutine diff_tracers_ale(tr_num, dynamics, tracers, ice, partit, mesh) !___________________________________________________________________________ if (tracers%data(tr_num)%i_vert_diff) then ! do vertical diffusion: implicite + + if (tracers%data(tr_num)%ltra_diag) then ! OG - tra_diag + do n=1, myDim_nod2D+eDim_nod2D + nu1 = ulevels_nod2D(n) + nl1 = nlevels_nod2D(n) + do nz = nu1, nl1-1 + ttf_rhs_bak(nz,n) = tracers%data(tr_num)%values(nz,n) + end do + end do + end if + + ! (w/out Redi) call diff_ver_part_impl_ale(tr_num, dynamics, tracers, ice, partit, mesh) + + ! vertical diffusion: implicit + if (tracers%data(tr_num)%ltra_diag) then ! OG - tra_diag + do n=1, myDim_nod2D+eDim_nod2D + nu1 = ulevels_nod2D(n) + nl1 = nlevels_nod2D(n) + do nz = nu1, nl1-1 + tracers%work%tra_diff_part_ver_impl(nz,n,tr_num) = tracers%data(tr_num)%values(nz,n) - ttf_rhs_bak(nz,n) + !if (mype==0) print *, tra_diff_part_ver_impl(:,:,tr_num) + end do + end do + end if + end if !We DO not set del_ttf to zero because it will not be used in this timestep anymore @@ -1482,6 +1644,10 @@ FUNCTION bc_surface(n, id, sval, nzmin, partit, mesh, sst, sss, aice) #if defined (__recom) use recoM_declarations use recom_glovar + use recom_config +#endif +#if defined (__ciso) + use recom_ciso #endif use mod_transit use g_clock @@ -1609,16 +1775,35 @@ FUNCTION bc_surface(n, id, sval, nzmin, partit, mesh, sst, sss, aice) !--- Done with boundary conditions for transient tracers. #if defined(__recom) CASE (1001) ! DIN + if (use_MEDUSA .and. add_loopback) then ! OG: add is_MEDUSA_loopback flag is_MEDUSA_loopback flag * lb_flux(n,1) + bc_surface= dt*(AtmNInput(n) + RiverDIN2D(n) * is_riverinput & + + ErosionTON2D(n) * is_erosioninput + lb_flux(n,1)) + else bc_surface= dt*(AtmNInput(n) + RiverDIN2D(n) * is_riverinput & + ErosionTON2D(n) * is_erosioninput) + end if + CASE (1002) ! DIC + if (use_MEDUSA .and. add_loopback) then + bc_surface= dt*(GloCO2flux_seaicemask(n) & + + RiverDIC2D(n) * is_riverinput & + + ErosionTOC2D(n) * is_erosioninput & + + lb_flux(n,2) + lb_flux(n,5)) + else bc_surface= dt*(GloCO2flux_seaicemask(n) & + RiverDIC2D(n) * is_riverinput & + ErosionTOC2D(n) * is_erosioninput) + end if + CASE (1003) ! Alk + if (use_MEDUSA .and. add_loopback) then + bc_surface= dt*(virtual_alk(n) + relax_alk(n) & + + RiverAlk2D(n) * is_riverinput & + + lb_flux(n,3) + lb_flux(n,5)*2) !CaCO3:Alk burial=1:2 + else bc_surface= dt*(virtual_alk(n) + relax_alk(n) & + RiverAlk2D(n) * is_riverinput) - !bc_surface=0.0_WP + end if CASE (1004:1010) bc_surface=0.0_WP CASE (1011) ! DON @@ -1628,16 +1813,58 @@ FUNCTION bc_surface(n, id, sval, nzmin, partit, mesh, sst, sss, aice) CASE (1013:1017) bc_surface=0.0_WP CASE (1018) ! DSi - bc_surface=dt*(RiverDSi2D(n) * is_riverinput + ErosionTSi2D(n) * is_erosioninput) + if (use_MEDUSA .and. add_loopback) then + bc_surface=dt*(RiverDSi2D(n) * is_riverinput & + + ErosionTSi2D(n) * is_erosioninput & + + lb_flux(n,4)) + else + bc_surface=dt*(RiverDSi2D(n) * is_riverinput + ErosionTSi2D(n) * is_erosioninput) + end if + CASE (1019) ! Fe + if (useRivFe) then + bc_surface= dt*(AtmFeInput(n) + RiverFe(n)) + else bc_surface= dt*AtmFeInput(n) + end if CASE (1020:1021) ! Cal bc_surface=0.0_WP CASE (1022) ! OXY bc_surface= dt*GloO2flux_seaicemask(n) ! bc_surface=0.0_WP - CASE (1023:1035) + CASE (1023:1036) bc_surface=0.0_WP ! OG added bc for recom fields + CASE (1302) ! Before (1037) ! DIC_13 + +#if defined (__ciso) + if (ciso) then + if (use_MEDUSA .and. add_loopback) then + bc_surface= dt*(GloCO2flux_seaicemask_13(n) & + + lb_flux(n,6) + lb_flux(n,7)) + else + bc_surface= dt*(GloCO2flux_seaicemask_13(n)) + end if + else + bc_surface=0.0_WP + end if +#endif + CASE (1305:1321) + bc_surface=0.0_WP ! organic 13C + CASE (1402) ! Before (1034) ! DIC_14 +#if defined (__ciso) + if (ciso .and. ciso_14) then + if (use_MEDUSA .and. add_loopback .and. ciso_organic_14) then + bc_surface= dt*(GloCO2flux_seaicemask_14(n) & + + lb_flux(n,8) + lb_flux(n,9)) + else + bc_surface= dt*GloCO2flux_seaicemask_14(n) + end if + else + bc_surface=0.0_WP + end if +#endif + CASE (1405:1421) + bc_surface=0.0_WP ! organic 14C #endif CASE (101) ! apply boundary conditions to tracer ID=101 bc_surface= dt*(prec_rain(n))! - real_salt_flux(n)*is_nonlinfs) diff --git a/src/oce_setup_step.F90 b/src/oce_setup_step.F90 index 18900f749..08c0474e7 100755 --- a/src/oce_setup_step.F90 +++ b/src/oce_setup_step.F90 @@ -314,12 +314,12 @@ SUBROUTINE tracer_init(tracers, partit, mesh) !___________________________________________________________________________ ! define tracer namelist parameter integer :: num_tracers - logical :: i_vert_diff, smooth_bh_tra + logical :: i_vert_diff, smooth_bh_tra , ltra_diag ! OG - tra_diag real(kind=WP) :: gamma0_tra, gamma1_tra, gamma2_tra integer :: AB_order = 2 namelist /tracer_listsize/ num_tracers namelist /tracer_list / nml_tracer_list - namelist /tracer_general / smooth_bh_tra, gamma0_tra, gamma1_tra, gamma2_tra, i_vert_diff, AB_order + namelist /tracer_general / smooth_bh_tra, gamma0_tra, gamma1_tra, gamma2_tra, i_vert_diff, AB_order, ltra_diag ! OG - tra_diag !___________________________________________________________________________ ! pointer on necessary derived types #include "associate_part_def.h" @@ -477,6 +477,7 @@ SUBROUTINE tracer_init(tracers, partit, mesh) tracers%data(n)%valuesAB = 0. tracers%data(n)%valuesold = 0. tracers%data(n)%i_vert_diff = i_vert_diff + tracers%data(n)%ltra_diag = ltra_diag ! OG - tra_diag end do allocate(tracers%work%del_ttf(nl-1,node_size)) allocate(tracers%work%del_ttf_advhoriz(nl-1,node_size),tracers%work%del_ttf_advvert(nl-1,node_size)) @@ -489,6 +490,20 @@ SUBROUTINE tracer_init(tracers, partit, mesh) tracers%work%dvd_trflx_hor = 0.0_WP tracers%work%dvd_trflx_ver = 0.0_WP end if + if (ltra_diag) then ! OG - tra_diag + allocate(tracers%work%tra_advhoriz(nl-1,node_size,num_tracers),tracers%work%tra_advvert(nl-1,node_size,num_tracers)) + tracers%work%tra_advhoriz = 0.0_WP + tracers%work%tra_advvert = 0.0_WP + allocate(tracers%work%tra_diff_part_hor_redi(nl-1,node_size,num_tracers),tracers%work%tra_diff_part_ver_expl(nl-1,node_size,num_tracers)) + allocate(tracers%work%tra_diff_part_ver_redi_expl(nl-1,node_size,num_tracers),tracers%work%tra_diff_part_ver_impl(nl-1,node_size,num_tracers)) + allocate(tracers%work%tra_recom_sms(nl-1,node_size,num_tracers)) + tracers%work%tra_diff_part_hor_redi = 0.0_WP + tracers%work%tra_diff_part_ver_expl = 0.0_WP + tracers%work%tra_diff_part_ver_redi_expl = 0.0_WP + tracers%work%tra_diff_part_ver_impl = 0.0_WP + tracers%work%tra_recom_sms = 0.0_WP + + end if END SUBROUTINE tracer_init ! ! @@ -1189,7 +1204,7 @@ SUBROUTINE oce_initial_state(tracers, partit, mesh) write (id_string, "(I4)") id write(*,*) 'initializing '//trim(i_string)//'th tracer with ID='//trim(id_string) end if - CASE (1023:1033) + CASE (1023:1036) tracers%data(i)%values(:,:)=0.0_WP if (mype==0) then write (i_string, "(I4)") i