Changeset 2819
- Timestamp:
- 2011-08-09T10:29:53+02:00 (13 years ago)
- Location:
- branches/2011/dev_r2787_LOCEAN3_TRA_TRP/NEMOGCM
- Files:
-
- 58 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2011/dev_r2787_LOCEAN3_TRA_TRP/NEMOGCM/CONFIG/GYRE_LOBSTER/EXP00/namelist_lobster
r2567 r2819 98 98 / 99 99 !''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' 100 &namlobdia ! additional 2D/3D tracers diagnostics ("key_trc_diaadd")100 &namlobdia ! additional 2D/3D tracers diagnostics 101 101 !,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, 102 nn_writedia = 360 ! time step frequency for tracers diagnostics103 !104 102 ! ! name ! title of ! units ! 105 103 ! ! ! the field ! ! … … 130 128 &namlobdbi ! biological diagnostics trends 131 129 !,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, 132 ! ! 3D bio diagnostics units : mmole/m3/s ("key_trc_diabio")133 130 ! ! 2D bio diagnostics units : mmole/m2/s ("key_trdmld_trc") 134 135 nwritebio = 4320 ! time step frequency for biological outputs136 !137 131 ! ! name ! title of the field ! units ! 138 132 lobdiabio(1) = 'NO3PHY' , 'Flux from NO3 to PHY ', 'mmole/m3/s' -
branches/2011/dev_r2787_LOCEAN3_TRA_TRP/NEMOGCM/CONFIG/GYRE_LOBSTER/EXP00/namelist_top
r2528 r2819 1 1 !!>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> 2 !! NEMO/TOP1 : 1 - tracer definition (namtrc ) 3 !! namelists 2 - dynamical tracer trends (namtrc_trd) 4 !! 3 - tracer advection (namtrc_adv) 5 !! 4 - tracer lateral diffusion (namtrc_ldf) 6 !! 5 - tracer vertical physics (namtrc_zdf) 7 !! 6 - tracer newtonian damping (namtrc_dmp) 2 !! NEMO/TOP2 namelits : 1 - tracer definition (namtrc ) 3 !! 2 - tracer advection (namtrc_adv) 4 !! 3 - tracer lateral diffusion (namtrc_ldf) 5 !! 4 - tracer vertical physics (namtrc_zdf) 6 !! 5 - tracer newtonian damping (namtrc_dmp) 7 !! 6 - dynamical tracer trends (namtrc_trd) 8 !! 7 - tracer output (namtrc_wri) 8 9 !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> 9 10 !''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' 10 11 &namtrc ! tracers definition 11 12 !,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, 13 ! 12 14 nn_dttrc = 1 ! time step frequency for passive sn_tracers 13 nn_writetrc = 360 ! time step frequency for sn_tracer outputs15 nn_writetrc = 60 ! time step frequency for sn_tracer outputs 14 16 ln_rsttr = .false. ! start from a restart file (T) or not (F) 15 nn_rsttr = 0! restart control = 0 initial time step is not compared to the restart file value17 nn_rsttr = 1 ! restart control = 0 initial time step is not compared to the restart file value 16 18 ! = 1 do not use the value in the restart file 17 19 ! = 2 calendar parameters read in the restart file 18 cn_trcrst_in = "restart_trc " ! suffix of pass. sn_tracer restart name (input)20 cn_trcrst_in = "restart_trc.nc" ! suffix of pass. sn_tracer restart name (input) 19 21 cn_trcrst_out = "restart_trc" ! suffix of pass. sn_tracer restart name (output) 22 ln_trcdta = .false. ! Initialisation from data input file (T) or not (F) 20 23 ! 21 ! ! name ! title of the field! units ! initial data ! save !22 ! ! !! ! from file ! or not !23 ! ! !! ! or not ! !24 sn_tracer(1) = 'DET' , 'Detritus ', 'mmole-N/m3' , .false. , .true.25 sn_tracer(2) = 'ZOO' , 'Zooplankton concentration ', 'mmole-N/m3' , .false. , .true.26 sn_tracer(3) = 'PHY' , 'Phytoplankton concentration', 'mmole-N/m3' , .false. , .true.27 sn_tracer(4) = 'NO3' , 'Nitrate concentration ', 'mmole-N/m3' , .false. , .true.28 sn_tracer(5) = 'NH4' , 'Ammonium concentration ', 'mmole-N/m3' , .false. , .true.29 sn_tracer(6) = 'DOM' , 'Dissolved organic matter ', 'mmole-N/m3' , .false. , .true.24 ! ! name ! title of the field ! units ! initial data ! save ! 25 ! ! ! ! ! from file ! or not ! 26 ! ! ! ! ! or not ! ! 27 sn_tracer(1) = 'DET' , 'Detritus ', 'mmole-N/m3' , .false. , .false. 28 sn_tracer(2) = 'ZOO' , 'Zooplankton concentration ', 'mmole-N/m3' , .false. , .false. 29 sn_tracer(3) = 'PHY' , 'Phytoplankton concentration', 'mmole-N/m3' , .false. , .false. 30 sn_tracer(4) = 'NO3' , 'Nitrate concentration ', 'mmole-N/m3' , .false. , .true. 31 sn_tracer(5) = 'NH4' , 'Ammonium concentration ', 'mmole-N/m3' , .false. , .false. 32 sn_tracer(6) = 'DOM' , 'Dissolved organic matter ', 'mmole-N/m3' , .false. , .false. 30 33 / 31 34 !----------------------------------------------------------------------- 32 &namtrc_ adv ! advection scheme for passive tracer35 &namtrc_dta ! Initialisation from data input file (T) or not (F) 33 36 !----------------------------------------------------------------------- 34 ln_trcadv_cen2 = .false. ! 2nd order centered scheme 37 ! 38 ! ! file name ! frequency (hours) ! variable ! time interp. ! clim ! 'yearly'/ ! weights ! rotation ! 39 ! ! ! (if <0 months) ! name ! (logical) ! (T/F) ! 'monthly' ! filename ! pairing ! 40 sn_trcdta(4) = 'NO3_R1' , -12 , 'NO3' , .false. , .true. , 'yearly' , '' , '' 41 42 cn_dir = './' ! root directory for the location of the runoff files 43 rn_trfac(4) = 1.0 ! - - - - - 44 / 45 !----------------------------------------------------------------------- 46 &namtrc_adv ! advection scheme for passive tracer 47 !----------------------------------------------------------------------- 48 ln_trcadv_cen2 = .false. ! 2nd order centered scheme 35 49 ln_trcadv_tvd = .true. ! TVD scheme 36 50 ln_trcadv_muscl = .false. ! MUSCL scheme … … 51 65 ln_trcldf_iso = .true. ! iso-neutral (require "key_ldfslp") 52 66 ! ! Coefficient 67 rn_ahtrc_0 = 1000. ! horizontal eddy diffusivity for tracers [m2/s] 53 68 rn_ahtrb_0 = 0. ! background eddy diffusivity for ldf_iso [m2/s] 54 69 / … … 60 75 / 61 76 !----------------------------------------------------------------------- 62 &namtrc_rad ! treatment of negative concentrations 77 &namtrc_rad ! treatment of negative concentrations 63 78 !----------------------------------------------------------------------- 64 79 ln_trcrad = .false. ! artificially correct negative concentrations (T) or not (F) 65 80 / 66 81 !----------------------------------------------------------------------- 67 &namtrc_dmp ! passive tracer newtonian damping ('key_tradmp && key_trcdmp')82 &namtrc_dmp ! passive tracer newtonian damping 68 83 !----------------------------------------------------------------------- 84 ln_trcdmp = .false. ! add a damping termn (T) or not (F) 69 85 nn_hdmp_tr = -1 ! horizontal shape =-1, damping in Med and Red Seas only 70 86 ! =XX, damping poleward of XX degrees (XX>0) … … 79 95 / 80 96 !----------------------------------------------------------------------- 81 &namtrc_trd ! diagnostics on tracer trends ('key_trdtrc')82 ! or mixed-layer trends ('key_trdmld_trc')97 &namtrc_trd ! diagnostics on tracer trends ('key_trdtrc') 98 ! or mixed-layer trends ('key_trdmld_trc') 83 99 !---------------------------------------------------------------------- 84 nn_trd_trc = 360! time step frequency and tracers trends85 nn_ctls_trc = 0! control surface type in mixed-layer trends (0,1 or n<jpk)86 rn_ucf_trc = 86400! unit conversion factor (=1 -> /seconds ; =86400. -> /day)100 nn_trd_trc = 5475 ! time step frequency and tracers trends 101 nn_ctls_trc = 0 ! control surface type in mixed-layer trends (0,1 or n<jpk) 102 rn_ucf_trc = 1 ! unit conversion factor (=1 -> /seconds ; =86400. -> /day) 87 103 ln_trdmld_trc_restart = .false. ! restart for ML diagnostics 88 ln_trdmld_trc_instant = . false. ! flag to diagnose trends of instantantaneous or mean ML T/S104 ln_trdmld_trc_instant = .true. ! flag to diagnose trends of instantantaneous or mean ML T/S 89 105 ln_trdtrc(1) = .true. 90 ln_trdtrc(2) = .true.91 ln_trdtrc(3) = .true.92 ln_trdtrc(4) = .true.93 ln_trdtrc(5) = .true.94 ln_trdtrc(6) = .true.95 106 / 107 !----------------------------------------------------------------------- 108 &namtrc_dia ! parameters for passive tracer additional diagnostics 109 !---------------------------------------------------------------------- 110 ln_diatrc = .true. ! save additional diag. (T) or not (F) 111 nn_writedia = 60 ! time step frequency for diagnostics 112 / -
branches/2011/dev_r2787_LOCEAN3_TRA_TRP/NEMOGCM/CONFIG/ORCA2_LIM/cpp_ORCA2_LIM.fcm
r2670 r2819 1 bld::tool::fppkeys key_trabbl key_vectopt_loop key_orca_r2 key_lim2 key_dynspg_flt key_diaeiv key_ldfslp key_traldf_c2d key_traldf_eiv key_dynldf_c3d key_ dtatem key_dtasal key_tradmp key_zdftke key_zdfddm key_zdftmx key_iomput1 bld::tool::fppkeys key_trabbl key_vectopt_loop key_orca_r2 key_lim2 key_dynspg_flt key_diaeiv key_ldfslp key_traldf_c2d key_traldf_eiv key_dynldf_c3d key_zdftke key_zdfddm key_zdftmx key_iomput -
branches/2011/dev_r2787_LOCEAN3_TRA_TRP/NEMOGCM/CONFIG/ORCA2_LIM_PISCES/EXP00/namelist_pisces
r2567 r2819 142 142 &nampisdia ! additional 2D/3D tracers diagnostics ("key_trc_diaadd") 143 143 !,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, 144 nn_writedia = 5475 ! time step frequency for tracers diagnostics145 !146 144 ! ! name ! title of the field ! units ! 147 145 ! ! ! ! ! -
branches/2011/dev_r2787_LOCEAN3_TRA_TRP/NEMOGCM/CONFIG/ORCA2_LIM_PISCES/EXP00/namelist_top
r2528 r2819 1 1 !!>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> 2 2 !! NEMO/TOP1 : 1 - tracer definition (namtrc ) 3 !! namelists 2 - dynamical tracer trends (namtrc_trd)3 !! 2 - tracer data initialisation (namtrc_dta) 4 4 !! 3 - tracer advection (namtrc_adv) 5 5 !! 4 - tracer lateral diffusion (namtrc_ldf) 6 6 !! 5 - tracer vertical physics (namtrc_zdf) 7 7 !! 6 - tracer newtonian damping (namtrc_dmp) 8 !! 7 - dynamical tracer trends (namtrc_trd) 9 !! 8 - tracer output diagonstics (namtrc_dia) 8 10 !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> 9 11 !''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' … … 18 20 cn_trcrst_in = "restart_trc" ! suffix of pass. sn_tracer restart name (input) 19 21 cn_trcrst_out = "restart_trc" ! suffix of pass. sn_tracer restart name (output) 22 ln_trcdta = .true. ! Initialisation from data input file (T) or not (F) 20 23 ! 21 24 ! ! name ! title of the field ! units ! initial data ! save ! … … 48 51 / 49 52 !----------------------------------------------------------------------- 53 &namtrc_dta ! Initialisation from data input file 54 !----------------------------------------------------------------------- 55 ! 56 ! ! file name ! frequency (hours) ! variable ! time interp. ! clim ! 'yearly'/ ! weights ! rotation ! 57 ! ! ! (if <0 months) ! name ! (logical) ! (T/F) ! 'monthly' ! filename ! pairing ! 58 sn_trcdta(1) = 'data_DIC_nomask' , -12 , 'DIC' , .false. , .true. , 'yearly' , '' , '' 59 sn_trcdta(2) = 'data_Alkalini_nomask' , -12 , 'Alkalini', .false. , .true. , 'yearly' , '' , '' 60 sn_trcdta(3) = 'data_O2_nomask' , -1 , 'O2' , .true. , .true. , 'yearly' , '' , '' 61 sn_trcdta(5) = 'data_PO4_nomask' , -1 , 'PO4' , .true. , .true. , 'yearly' , '' , '' 62 sn_trcdta(7) = 'data_Si_nomask' , -1 , 'Si' , .true. , .true. , 'yearly' , '' , '' 63 sn_trcdta(10) = 'data_DOC_nomask' , -12 , 'DOC' , .false. , .true. , 'yearly' , '' , '' 64 sn_trcdta(14) = 'data_Fer_nomask' , -12 , 'Fer' , .false. , .true. , 'yearly' , '' , '' 65 sn_trcdta(23) = 'data_NO3_nomask' , -1 , 'NO3' , .true. , .true. , 'yearly' , '' , '' 66 ! 67 cn_dir = './' ! root directory for the location of the data files 68 rn_trfac(1) = 1.0e-06 ! multiplicative factor 69 rn_trfac(2) = 1.0e-06 ! - - - - 70 rn_trfac(3) = 44.6e-06 ! - - - - 71 rn_trfac(5) = 122.0e-06 ! - - - - 72 rn_trfac(7) = 1.0e-06 ! - - - - 73 rn_trfac(10) = 1.0 ! - - - - 74 rn_trfac(14) = 1.0 ! - - - - 75 rn_trfac(23) = 7.6e-06 ! - - - - 76 / 77 !----------------------------------------------------------------------- 50 78 &namtrc_adv ! advection scheme for passive tracer 51 79 !----------------------------------------------------------------------- … … 69 97 ln_trcldf_iso = .true. ! iso-neutral (require "key_ldfslp") 70 98 ! ! Coefficient 99 rn_ahtrc_0 = 2000. ! horizontal eddy diffusivity for tracers [m2/s] 71 100 rn_ahtrb_0 = 0. ! background eddy diffusivity for ldf_iso [m2/s] 72 101 / … … 83 112 / 84 113 !----------------------------------------------------------------------- 85 &namtrc_dmp ! passive tracer newtonian damping ('key_tradmp && key_trcdmp')114 &namtrc_dmp ! passive tracer newtonian damping 86 115 !----------------------------------------------------------------------- 116 ln_trcdmp = .false. ! add a damping termn (T) or not (F) 87 117 nn_hdmp_tr = -1 ! horizontal shape =-1, damping in Med and Red Seas only 88 118 ! =XX, damping poleward of XX degrees (XX>0) … … 107 137 ln_trdtrc(1) = .true. 108 138 ln_trdtrc(2) = .true. 109 ln_trdtrc(3) = .false.110 ln_trdtrc(4) = .false.111 ln_trdtrc(5) = .false.112 ln_trdtrc(6) = .false.113 ln_trdtrc(7) = .false.114 ln_trdtrc(8) = .false.115 ln_trdtrc(9) = .false.116 ln_trdtrc(10) = .false.117 ln_trdtrc(11) = .false.118 ln_trdtrc(12) = .false.119 ln_trdtrc(13) = .false.120 ln_trdtrc(14) = .false.121 ln_trdtrc(15) = .false.122 ln_trdtrc(16) = .false.123 ln_trdtrc(17) = .false.124 ln_trdtrc(18) = .false.125 ln_trdtrc(19) = .false.126 ln_trdtrc(20) = .false.127 ln_trdtrc(21) = .false.128 ln_trdtrc(22) = .false.129 139 ln_trdtrc(23) = .true. 130 ln_trdtrc(24) = .false.131 140 / 141 !----------------------------------------------------------------------- 142 &namtrc_dia ! parameters for passive tracer additional diagnostics 143 !---------------------------------------------------------------------- 144 ln_diatrc = .true. ! save additional diag. (T) or not (F) 145 nn_writedia = 5475 ! time step frequency for diagnostics 146 / -
branches/2011/dev_r2787_LOCEAN3_TRA_TRP/NEMOGCM/CONFIG/ORCA2_LIM_PISCES/cpp_ORCA2_LIM_PISCES.fcm
r2670 r2819 1 bld::tool::fppkeys key_trabbl key_vectopt_loop key_orca_r2 key_lim2 key_dynspg_flt key_diaeiv key_ldfslp key_traldf_c2d key_traldf_eiv key_dynldf_c3d key_ dtatem key_dtasal key_tradmp key_zdftke key_zdfddm key_top key_pisces key_dtatrc key_diatrckey_iomput1 bld::tool::fppkeys key_trabbl key_vectopt_loop key_orca_r2 key_lim2 key_dynspg_flt key_diaeiv key_ldfslp key_traldf_c2d key_traldf_eiv key_dynldf_c3d key_zdfddm key_top key_pisces key_iomput -
branches/2011/dev_r2787_LOCEAN3_TRA_TRP/NEMOGCM/CONFIG/ORCA2_OFF_PISCES/EXP00/namelist_top
r2528 r2819 1 1 !!>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> 2 2 !! NEMO/TOP1 : 1 - tracer definition (namtrc ) 3 !! namelists 2 - dynamical tracer trends (namtrc_trd)3 !! 2 - tracer data initialisation (namtrc_dta) 4 4 !! 3 - tracer advection (namtrc_adv) 5 5 !! 4 - tracer lateral diffusion (namtrc_ldf) 6 6 !! 5 - tracer vertical physics (namtrc_zdf) 7 7 !! 6 - tracer newtonian damping (namtrc_dmp) 8 !! 7 - dynamical tracer trends (namtrc_trd) 9 !! 8 - tracer output diagonstics (namtrc_dia) 8 10 !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> 9 11 !''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' … … 18 20 cn_trcrst_in = "restart_trc" ! suffix of pass. sn_tracer restart name (input) 19 21 cn_trcrst_out = "restart_trc" ! suffix of pass. sn_tracer restart name (output) 22 ln_trcdta = .true. ! Initialisation from data input file (T) or not (F) 20 23 ! 21 24 ! ! name ! title of the field ! units ! initial data ! save ! … … 48 51 / 49 52 !----------------------------------------------------------------------- 53 &namtrc_dta ! Initialisation from data input file 54 !----------------------------------------------------------------------- 55 ! 56 ! ! file name ! frequency (hours) ! variable ! time interp. ! clim ! 'yearly'/ ! weights ! rotation ! 57 ! ! ! (if <0 months) ! name ! (logical) ! (T/F) ! 'monthly' ! filename ! pairing ! 58 sn_trcdta(1) = 'data_DIC_nomask' , -12 , 'DIC' , .false. , .true. , 'yearly' , '' , '' 59 sn_trcdta(2) = 'data_Alkalini_nomask' , -12 , 'Alkalini', .false. , .true. , 'yearly' , '' , '' 60 sn_trcdta(3) = 'data_O2_nomask' , -1 , 'O2' , .true. , .true. , 'yearly' , '' , '' 61 sn_trcdta(5) = 'data_PO4_nomask' , -1 , 'PO4' , .true. , .true. , 'yearly' , '' , '' 62 sn_trcdta(7) = 'data_Si_nomask' , -1 , 'Si' , .true. , .true. , 'yearly' , '' , '' 63 sn_trcdta(10) = 'data_DOC_nomask' , -12 , 'DOC' , .false. , .true. , 'yearly' , '' , '' 64 sn_trcdta(14) = 'data_Fer_nomask' , -12 , 'Fer' , .false. , .true. , 'yearly' , '' , '' 65 sn_trcdta(23) = 'data_NO3_nomask' , -1 , 'NO3' , .true. , .true. , 'yearly' , '' , '' 66 ! 67 cn_dir = './' ! root directory for the location of the data files 68 rn_trfac(1) = 1.0e-06 ! multiplicative factor 69 rn_trfac(2) = 1.0e-06 ! - - - - 70 rn_trfac(3) = 44.6e-06 ! - - - - 71 rn_trfac(5) = 122.0e-06 ! - - - - 72 rn_trfac(7) = 1.0e-06 ! - - - - 73 rn_trfac(10) = 1.0 ! - - - - 74 rn_trfac(14) = 1.0 ! - - - - 75 rn_trfac(23) = 7.6e-06 ! - - - - 76 / 77 !----------------------------------------------------------------------- 50 78 &namtrc_adv ! advection scheme for passive tracer 51 79 !----------------------------------------------------------------------- … … 69 97 ln_trcldf_iso = .true. ! iso-neutral (require "key_ldfslp") 70 98 ! ! Coefficient 99 rn_ahtrc_0 = 2000. ! horizontal eddy diffusivity for tracers [m2/s] 71 100 rn_ahtrb_0 = 0. ! background eddy diffusivity for ldf_iso [m2/s] 72 101 / … … 83 112 / 84 113 !----------------------------------------------------------------------- 85 &namtrc_dmp ! passive tracer newtonian damping ('key_tradmp && key_trcdmp')114 &namtrc_dmp ! passive tracer newtonian damping 86 115 !----------------------------------------------------------------------- 116 ln_trcdmp = .false. ! add a damping termn (T) or not (F) 87 117 nn_hdmp_tr = -1 ! horizontal shape =-1, damping in Med and Red Seas only 88 118 ! =XX, damping poleward of XX degrees (XX>0) … … 107 137 ln_trdtrc(1) = .true. 108 138 ln_trdtrc(2) = .true. 109 ln_trdtrc(3) = .false.110 ln_trdtrc(4) = .false.111 ln_trdtrc(5) = .false.112 ln_trdtrc(6) = .false.113 ln_trdtrc(7) = .false.114 ln_trdtrc(8) = .false.115 ln_trdtrc(9) = .false.116 ln_trdtrc(10) = .false.117 ln_trdtrc(11) = .false.118 ln_trdtrc(12) = .false.119 ln_trdtrc(13) = .false.120 ln_trdtrc(14) = .false.121 ln_trdtrc(15) = .false.122 ln_trdtrc(16) = .false.123 ln_trdtrc(17) = .false.124 ln_trdtrc(18) = .false.125 ln_trdtrc(19) = .false.126 ln_trdtrc(20) = .false.127 ln_trdtrc(21) = .false.128 ln_trdtrc(22) = .false.129 139 ln_trdtrc(23) = .true. 130 ln_trdtrc(24) = .false.131 140 / 141 !----------------------------------------------------------------------- 142 &namtrc_dia ! parameters for passive tracer additional diagnostics 143 !---------------------------------------------------------------------- 144 ln_diatrc = .true. ! save additional diag. (T) or not (F) 145 nn_writedia = 1460 ! time step frequency for diagnostics 146 / -
branches/2011/dev_r2787_LOCEAN3_TRA_TRP/NEMOGCM/CONFIG/ORCA2_OFF_PISCES/cpp_ORCA2_OFF_PISCES.fcm
r2787 r2819 1 bld::tool::fppkeys key_trabbl key_vectopt_loop key_orca_r2 key_ldfslp key_traldf_c2d key_traldf_eiv key_top key_offline key_pisces key_ dtatrc key_diatrc key_iomput1 bld::tool::fppkeys key_trabbl key_vectopt_loop key_orca_r2 key_ldfslp key_traldf_c2d key_traldf_eiv key_top key_offline key_pisces key_iomput -
branches/2011/dev_r2787_LOCEAN3_TRA_TRP/NEMOGCM/NEMO/OPA_SRC/LDF/ldftra_oce.F90
r2715 r2819 34 34 LOGICAL , PUBLIC :: l_triad_iso = .FALSE. !: calculate triads twice 35 35 LOGICAL , PUBLIC :: l_no_smooth = .FALSE. !: no Shapiro smoothing 36 37 REAL(wp), PUBLIC :: rldf !: multiplicative factor of diffusive coefficient 38 !: Needed to define the ratio between passive and active tracer diffusion coef. 36 39 37 40 #if defined key_traldf_c3d -
branches/2011/dev_r2787_LOCEAN3_TRA_TRP/NEMOGCM/NEMO/OPA_SRC/LDF/ldftra_substitute.h90
r2528 r2819 12 12 #if defined key_traldf_c3d 13 13 ! 'key_traldf_c3d' : aht: 3D coefficient 14 # define fsahtt(i,j,k) ahtt(i,j,k)15 # define fsahtu(i,j,k) ahtu(i,j,k)16 # define fsahtv(i,j,k) ahtv(i,j,k)17 # define fsahtw(i,j,k) ahtw(i,j,k)14 # define fsahtt(i,j,k) rldf * ahtt(i,j,k) 15 # define fsahtu(i,j,k) rldf * ahtu(i,j,k) 16 # define fsahtv(i,j,k) rldf * ahtv(i,j,k) 17 # define fsahtw(i,j,k) rldf * ahtw(i,j,k) 18 18 #elif defined key_traldf_c2d 19 19 ! 'key_traldf_c2d' : aht: 2D coefficient 20 # define fsahtt(i,j,k) ahtt(i,j)21 # define fsahtu(i,j,k) ahtu(i,j)22 # define fsahtv(i,j,k) ahtv(i,j)23 # define fsahtw(i,j,k) ahtw(i,j)20 # define fsahtt(i,j,k) rldf * ahtt(i,j) 21 # define fsahtu(i,j,k) rldf * ahtu(i,j) 22 # define fsahtv(i,j,k) rldf * ahtv(i,j) 23 # define fsahtw(i,j,k) rldf * ahtw(i,j) 24 24 #elif defined key_traldf_c1d 25 25 ! 'key_traldf_c1d' : aht: 1D coefficient 26 # define fsahtt(i,j,k) ahtt(k)27 # define fsahtu(i,j,k) ahtu(k)28 # define fsahtv(i,j,k) ahtv(k)29 # define fsahtw(i,j,k) ahtw(k)26 # define fsahtt(i,j,k) rldf * ahtt(k) 27 # define fsahtu(i,j,k) rldf * ahtu(k) 28 # define fsahtv(i,j,k) rldf * ahtv(k) 29 # define fsahtw(i,j,k) rldf * ahtw(k) 30 30 #else 31 31 ! Default option : aht: Constant coefficient 32 # define fsahtt(i,j,k) aht033 # define fsahtu(i,j,k) aht034 # define fsahtv(i,j,k) aht035 # define fsahtw(i,j,k) aht032 # define fsahtt(i,j,k) rldf * aht0 33 # define fsahtu(i,j,k) rldf * aht0 34 # define fsahtv(i,j,k) rldf * aht0 35 # define fsahtw(i,j,k) rldf * aht0 36 36 #endif -
branches/2011/dev_r2787_LOCEAN3_TRA_TRP/NEMOGCM/NEMO/OPA_SRC/TRA/traldf.F90
r2715 r2819 61 61 REAL(wp), DIMENSION(:,:,:), ALLOCATABLE :: ztrdt, ztrds 62 62 !!---------------------------------------------------------------------- 63 64 rldf = 1 ! For active tracers the 63 65 64 66 IF( l_trdtra ) THEN !* Save ta and sa trends -
branches/2011/dev_r2787_LOCEAN3_TRA_TRP/NEMOGCM/NEMO/OPA_SRC/trc_oce.F90
r2715 r2819 48 48 !!---------------------------------------------------------------------- 49 49 LOGICAL, PUBLIC, PARAMETER :: lk_offline = .FALSE. !: offline flag 50 #endif 51 #if defined key_degrad 52 !!---------------------------------------------------------------------- 53 !! 'key_degrad' Degradation mode 54 !!---------------------------------------------------------------------- 55 LOGICAL, PUBLIC, PARAMETER :: lk_degrad = .TRUE. !: degradation flag 56 #else 57 !!---------------------------------------------------------------------- 58 !! Default option NO Degradation mode 59 !!---------------------------------------------------------------------- 60 LOGICAL, PUBLIC, PARAMETER :: lk_degrad = .FALSE. !: degradation flag 50 61 #endif 51 62 -
branches/2011/dev_r2787_LOCEAN3_TRA_TRP/NEMOGCM/NEMO/TOP_SRC/C14b/trcini_c14b.F90
r2715 r2819 181 181 IF( ctrcnm(jpc14) /= 'C14B' ) THEN 182 182 ctrcnm(jpc14) = 'C14B' 183 ctrc nl(jpc14) = 'Bomb C14 concentration'183 ctrcln(jpc14) = 'Bomb C14 concentration' 184 184 ENDIF 185 185 186 186 IF(lwp) THEN 187 187 CALL ctl_warn( ' we force tracer names' ) 188 WRITE(numout,*) ' tracer nb: ',jpc14,' name = ',ctrcnm(jpc14), ctrc nl(jpc14)188 WRITE(numout,*) ' tracer nb: ',jpc14,' name = ',ctrcnm(jpc14), ctrcln(jpc14) 189 189 WRITE(numout,*) ' ' 190 190 ENDIF -
branches/2011/dev_r2787_LOCEAN3_TRA_TRP/NEMOGCM/NEMO/TOP_SRC/C14b/trcnam_c14b.F90
r2715 r2819 16 16 USE trc ! TOP variables 17 17 USE trcsms_c14b ! C14b specific variable 18 USE iom ! I/O manager 18 19 19 20 IMPLICIT NONE … … 43 44 INTEGER :: numnatb 44 45 45 #if defined key_diatrc && ! defined key_iomput46 46 ! definition of additional diagnostic as a structure 47 INTEGER :: jl, jn 48 TYPE DIAG 49 CHARACTER(len = 20) :: snamedia !: short name 50 CHARACTER(len = 80 ) :: lnamedia !: long name 51 CHARACTER(len = 20 ) :: unitdia !: unit 52 END TYPE DIAG 53 54 TYPE(DIAG) , DIMENSION(jp_c14b_2d) :: c14dia2d 55 TYPE(DIAG) , DIMENSION(jp_c14b_3d) :: c14dia3d 56 #endif 47 INTEGER :: jl, jn 48 TYPE(DIAG), DIMENSION(jp_c14b_2d) :: c14dia2d 49 TYPE(DIAG), DIMENSION(jp_c14b_3d) :: c14dia3d 57 50 !! 58 51 NAMELIST/namc14date/ ndate_beg_b, nyear_res_b 59 #if defined key_diatrc && ! defined key_iomput 60 NAMELIST/namc14dia/nn_writedia, c14dia2d, c14dia3d ! additional diagnostics 61 #endif 52 NAMELIST/namc14dia/ c14dia2d, c14dia3d ! additional diagnostics 62 53 !!------------------------------------------------------------------- 63 54 … … 80 71 IF(lwp) WRITE(numout,*) ' initial year (aa) nyear_beg_b = ', nyear_beg_b 81 72 ! 82 #if defined key_diatrc && ! defined key_iomput 73 IF( .NOT.lk_iomput .AND. ln_diatrc ) THEN 74 ! 75 ! Namelist namc14dia 76 ! ------------------- 77 DO jl = 1, jp_c14b_2d 78 WRITE(c14dia2d(jl)%sname,'("2D_",I1)') jl ! short name 79 WRITE(c14dia2d(jl)%lname,'("2D DIAGNOSTIC NUMBER ",I2)') jl ! long name 80 c14dia2d(jl)%units = ' ' ! units 81 END DO 82 ! ! 3D output arrays 83 DO jl = 1, jp_c14b_3d 84 WRITE(c14dia3d(jl)%sname,'("3D_",I1)') jl ! short name 85 WRITE(c14dia3d(jl)%lname,'("3D DIAGNOSTIC NUMBER ",I2)') jl ! long name 86 c14dia3d(jl)%units = ' ' ! units 87 END DO 83 88 84 ! Namelist namc14dia 85 ! ------------------- 86 nn_writedia = 10 ! default values 87 88 DO jl = 1, jp_c14b_2d 89 jn = jp_c14b0_2d + jl - 1 90 WRITE(ctrc2d(jn),'("2D_",I1)') jn ! short name 91 WRITE(ctrc2l(jn),'("2D DIAGNOSTIC NUMBER ",I2)') jn ! long name 92 ctrc2u(jn) = ' ' ! units 93 END DO 94 ! ! 3D output arrays 95 DO jl = 1, jp_c14b_3d 96 jn = jp_c14b0_3d + jl - 1 97 WRITE(ctrc3d(jn),'("3D_",I1)') jn ! short name 98 WRITE(ctrc3l(jn),'("3D DIAGNOSTIC NUMBER ",I2)') jn ! long name 99 ctrc3u(jn) = ' ' ! units 100 END DO 101 102 REWIND( numnatb ) ! read natrtd 103 READ ( numnatb, namc14dia ) 104 105 DO jl = 1, jp_c14b_2d 106 jn = jp_c14b0_2d + jl - 1 107 ctrc2d(jn) = c14dia2d(jl)%snamedia 108 ctrc2l(jn) = c14dia2d(jl)%lnamedia 109 ctrc2u(jn) = c14dia2d(jl)%unitdia 110 END DO 111 112 DO jl = 1, jp_c14b_3d 113 jn = jp_c14b0_3d + jl - 1 114 ctrc3d(jn) = c14dia3d(jl)%snamedia 115 ctrc3l(jn) = c14dia3d(jl)%lnamedia 116 ctrc3u(jn) = c14dia3d(jl)%unitdia 117 END DO 118 119 IF(lwp) THEN ! control print 120 WRITE(numout,*) 121 WRITE(numout,*) ' Namelist : natadd' 122 WRITE(numout,*) ' frequency of outputs for additional arrays nn_writedia = ', nn_writedia 123 DO jl = 1, jp_c14b_3d 124 jn = jp_c14b0_3d + jl - 1 125 WRITE(numout,*) ' 3d output field No : ',jn 126 WRITE(numout,*) ' short name : ', TRIM(ctrc3d(jn)) 127 WRITE(numout,*) ' long name : ', TRIM(ctrc3l(jn)) 128 WRITE(numout,*) ' unit : ', TRIM(ctrc3u(jn)) 129 WRITE(numout,*) ' ' 130 END DO 89 REWIND( numnatb ) ! 90 READ ( numnatb, namc14dia ) 131 91 132 92 DO jl = 1, jp_c14b_2d 133 93 jn = jp_c14b0_2d + jl - 1 134 WRITE(numout,*) ' 2d output field No : ',jn 135 WRITE(numout,*) ' short name : ', TRIM(ctrc2d(jn)) 136 WRITE(numout,*) ' long name : ', TRIM(ctrc2l(jn)) 137 WRITE(numout,*) ' unit : ', TRIM(ctrc2u(jn)) 94 ctrc2d(jn) = c14dia2d(jl)%sname 95 ctrc2l(jn) = c14dia2d(jl)%lname 96 ctrc2u(jn) = c14dia2d(jl)%units 97 END DO 98 99 DO jl = 1, jp_c14b_3d 100 jn = jp_c14b0_3d + jl - 1 101 ctrc3d(jn) = c14dia3d(jl)%sname 102 ctrc3l(jn) = c14dia3d(jl)%lname 103 ctrc3u(jn) = c14dia3d(jl)%units 104 END DO 105 106 IF(lwp) THEN ! control print 107 WRITE(numout,*) 108 WRITE(numout,*) ' Namelist : natadd' 109 DO jl = 1, jp_c14b_3d 110 jn = jp_c14b0_3d + jl - 1 111 WRITE(numout,*) ' 3d diag nb : ', jn, ' short name : ', ctrc3d(jn), & 112 & ' long name : ', ctrc3l(jn), ' unit : ', ctrc3u(jn) 113 END DO 138 114 WRITE(numout,*) ' ' 139 END DO 115 116 DO jl = 1, jp_c14b_2d 117 jn = jp_c14b0_2d + jl - 1 118 WRITE(numout,*) ' 2d diag nb : ', jn, ' short name : ', ctrc2d(jn), & 119 & ' long name : ', ctrc2l(jn), ' unit : ', ctrc2u(jn) 120 END DO 121 WRITE(numout,*) ' ' 122 ENDIF 123 ! 140 124 ENDIF 141 142 #endif143 125 144 126 END SUBROUTINE trc_nam_c14b -
branches/2011/dev_r2787_LOCEAN3_TRA_TRP/NEMOGCM/NEMO/TOP_SRC/C14b/trcsms_c14b.F90
r2715 r2819 246 246 #endif 247 247 & * tmask(ji,jj,1) * ( 1. - fr_i(ji,jj) ) / 2. 248 249 248 ! Add the surface flux to the trend 250 249 tra(ji,jj,1,jpc14) = tra(ji,jj,1,jpc14) + qtr_c14(ji,jj) / fse3t(ji,jj,1) … … 253 252 qint_c14(ji,jj) = qint_c14(ji,jj) + qtr_c14(ji,jj) * rdt 254 253 255 # if defined key_diatrc && ! defined key_iomput 256 ! Save 2D diagnostics 257 trc2d(ji,jj,jp_c14b0_2d ) = qtr_c14 (ji,jj) 258 trc2d(ji,jj,jp_c14b0_2d + 1) = qint_c14(ji,jj) 259 # endif 254 ! ! Save 2D diagnostics 255 IF( .NOT.lk_iomput .AND. ln_diatrc ) THEN 256 trc2d(ji,jj,jp_c14b0_2d ) = qtr_c14 (ji,jj) 257 trc2d(ji,jj,jp_c14b0_2d + 1) = qint_c14(ji,jj) 258 ENDIF 259 ! 260 260 END DO 261 261 END DO … … 265 265 DO jj = 1, jpj 266 266 DO ji = 1, jpi 267 #if ! defined key_degrad 267 #if defined key_degrad 268 ztra = trn(ji,jj,jk,jpc14) * ( 1. - EXP( -xlambda * rdt * facvol(ji,jj,jk) ) ) 269 #else 268 270 ztra = trn(ji,jj,jk,jpc14) * xaccum 269 #else270 ztra = trn(ji,jj,jk,jpc14) * ( 1. - EXP( -xlambda * rdt * facvol(ji,jj,jk) ) )271 271 #endif 272 272 tra(ji,jj,jk,jpc14) = tra(ji,jj,jk,jpc14) - ztra / rdt 273 #if defined key_diatrc 274 ! Save 3D diagnostics 275 # if ! defined key_iomput 276 trc3d(ji,jj,jk,jp_c14b0_3d ) = ztra ! radioactive decay 277 # else 278 zw3d(ji,jj,jk) = ztra ! radioactive decay 279 # endif 280 #endif 273 ! ! save 3D diag : radioactive decay 274 IF( ln_diatrc ) THEN 275 IF( lk_iomput ) THEN ; zw3d(ji,jj,jk) = ztra 276 ELSE ; trc3d(ji,jj,jk,jp_c14b0_3d ) = ztra 277 ENDIF 278 ENDIF 279 ! 281 280 END DO 282 281 END DO 283 282 END DO 284 283 285 #if defined key_diatrc && defined key_iomput 286 CALL iom_put( "qtrC14b" , qtr_c14 ) 287 CALL iom_put( "qintC14b" , qint_c14 ) 288 #endif 289 #if defined key_diatrc && defined key_iomput 290 CALL iom_put( "fdecay" , zw3d ) 291 #endif 292 IF( l_trdtrc ) CALL trd_mod_trc( tra(:,:,:,jpc14), jpc14, jptra_trd_sms, kt ) ! save trends 284 IF( lk_iomput ) THEN 285 CALL iom_put( "qtrC14b" , qtr_c14 ) 286 CALL iom_put( "qintC14b" , qint_c14 ) 287 CALL iom_put( "fdecay" , zw3d ) 288 ENDIF 289 290 IF( l_trdtrc ) CALL trd_mod_trc( tra(:,:,:,jpc14), jpc14, jptra_trd_sms, kt ) ! save trends 293 291 294 292 IF( wrk_not_released(2, 1) .OR. & -
branches/2011/dev_r2787_LOCEAN3_TRA_TRP/NEMOGCM/NEMO/TOP_SRC/CFC/par_cfc.F90
r2528 r2819 32 32 !!--------------------------------------------------------------------- 33 33 LOGICAL, PUBLIC, PARAMETER :: lk_cfc = .TRUE. !: CFC flag 34 INTEGER, PUBLIC, PARAMETER :: jp_cfc = 2!: number of passive tracers34 INTEGER, PUBLIC, PARAMETER :: jp_cfc = 1 !: number of passive tracers 35 35 INTEGER, PUBLIC, PARAMETER :: jp_cfc_2d = 2 !: additional 2d output arrays ('key_trc_diaadd') 36 36 INTEGER, PUBLIC, PARAMETER :: jp_cfc_3d = 0 !: additional 3d output arrays ('key_trc_diaadd') -
branches/2011/dev_r2787_LOCEAN3_TRA_TRP/NEMOGCM/NEMO/TOP_SRC/CFC/trcini_cfc.F90
r2715 r2819 4 4 !! TOP : initialisation of the CFC tracers 5 5 !!====================================================================== 6 !! History : 2.0 ! 2007-12 (C. Ethe, G. Madec) from trcini.cfc.h906 !! History : 2.0 ! 2007-12 (C. Ethe, G. Madec) 7 7 !!---------------------------------------------------------------------- 8 8 #if defined key_cfc … … 43 43 !! ** Method : - Read the namcfc namelist and check the parameter values 44 44 !!---------------------------------------------------------------------- 45 INTEGER :: ji, jj, jn, jl, jm, js 45 INTEGER :: ji, jj, jn, jl, jm, js, io, ierr 46 INTEGER :: iskip = 6 ! number of 1st descriptor lines 46 47 REAL(wp) :: zyy, zyd 47 48 !!---------------------------------------------------------------------- … … 51 52 IF(lwp) WRITE(numout,*) ' ~~~~~~~~~~~' 52 53 54 55 IF(lwp) WRITE(numout,*) 'read of formatted file cfc1112atm' 56 57 CALL ctl_opn( inum, clname, 'OLD', 'FORMATTED', 'SEQUENTIAL', -1, numout, .FALSE. ) 58 REWIND(inum) 59 60 ! compute the number of year in the file 61 ! file starts in 1931 do jn represent the year in the century 62 jn = 31 63 DO 64 READ(inum,'(1x)',END=100) 65 jn = jn + 1 66 END DO 67 100 jpyear = jn - 1 - iskip 68 IF ( lwp) WRITE(numout,*) ' ', jpyear ,' years read' 53 69 ! ! Allocate CFC arrays 70 71 ALLOCATE( p_cfc(jpyear,jphem,2), STAT=ierr ) 72 IF( ierr > 0 ) THEN 73 CALL ctl_stop( 'trc_ini_cfc: unable to allocate p_cfc array' ) ; RETURN 74 ENDIF 54 75 IF( trc_sms_cfc_alloc() /= 0 ) CALL ctl_stop( 'STOP', 'trc_ini_cfc: unable to allocate CFC arrays' ) 55 76 … … 75 96 ENDIF 76 97 77 78 ! READ CFC partial pressure atmospheric value :79 ! p11(year,nt) = PCFC11 in northern (1) and southern (2) hemisphere80 ! p12(year,nt) = PCFC12 in northern (1) and southern (2) hemisphere81 !--------------------------------------------------------------------82 83 IF(lwp) WRITE(numout,*) 'read of formatted file cfc1112atm'84 85 CALL ctl_opn( inum, clname, 'OLD', 'FORMATTED', 'SEQUENTIAL', -1, numout, .FALSE. )86 98 REWIND(inum) 87 99 88 DO jm = 1, 6! Skip over 1st six descriptor lines100 DO jm = 1, iskip ! Skip over 1st six descriptor lines 89 101 READ(inum,'(1x)') 90 102 END DO 91 92 103 ! file starts in 1931 do jn represent the year in the century.jhh 93 104 ! Read file till the end 94 105 jn = 31 95 DO WHILE ( 1 /= 2 ) 96 READ(inum,*,END=100) zyy, p_cfc(jn,1,1), p_cfc(jn,1,2), p_cfc(jn,2,1), p_cfc(jn,2,2) 97 IF ( lwp) THEN 98 WRITE(numout,'(f7.2, 4f8.2)' ) & 99 & zyy, p_cfc(jn,1,1), p_cfc(jn,1,2), p_cfc(jn,2,1), p_cfc(jn,2,2) 100 ENDIF 101 jn = jn + 1 106 DO 107 READ(inum,*, IOSTAT=io) zyy, p_cfc(jn,1,1), p_cfc(jn,1,2), p_cfc(jn,2,1), p_cfc(jn,2,2) 108 IF( io < 0 ) exit 109 jn = jn + 1 102 110 END DO 103 100 npyear = jn - 1104 IF ( lwp) WRITE(numout,*) ' ', npyear ,' years read'105 111 106 112 p_cfc(32,1:2,1) = 5.e-4 ! modify the values of the first years … … 116 122 WRITE(numout,*) 117 123 WRITE(numout,*) ' Year p11HN p11HS p12HN p12HS ' 118 DO jn = 30, 100124 DO jn = 30, jpyear 119 125 WRITE(numout, '( 1I4, 4F9.2)') jn, p_cfc(jn,1,1), p_cfc(jn,2,1), p_cfc(jn,1,2), p_cfc(jn,2,2) 120 126 END DO -
branches/2011/dev_r2787_LOCEAN3_TRA_TRP/NEMOGCM/NEMO/TOP_SRC/CFC/trcnam_cfc.F90
r2715 r2819 16 16 USE trc ! TOP variables 17 17 USE trcsms_cfc ! CFC specific variable 18 USE iom ! I/O manager 18 19 19 20 IMPLICIT NONE … … 41 42 !! ** input : Namelist namcfc 42 43 !!---------------------------------------------------------------------- 43 INTEGER :: numnatc 44 #if defined key_diatrc && ! defined key_iomput 45 ! definition of additional diagnostic as a structure 44 INTEGER :: numnatc 46 45 INTEGER :: jl, jn 47 TYPE DIAG 48 CHARACTER(len = 20) :: snamedia !: short name 49 CHARACTER(len = 80 ) :: lnamedia !: long name 50 CHARACTER(len = 20 ) :: unitdia !: unit 51 END TYPE DIAG 52 53 TYPE(DIAG) , DIMENSION(jp_cfc_2d) :: cfcdia2d 54 #endif 46 TYPE(DIAG), DIMENSION(jp_cfc_2d) :: cfcdia2d 55 47 !! 56 48 NAMELIST/namcfcdate/ ndate_beg, nyear_res 57 #if defined key_diatrc && ! defined key_iomput 58 NAMELIST/namcfcdia/nn_writedia, cfcdia2d ! additional diagnostics 59 #endif 49 NAMELIST/namcfcdia/ cfcdia2d ! additional diagnostics 60 50 !!------------------------------------------------------------------- 61 51 … … 78 68 IF(lwp) WRITE(numout,*) ' initial year (aa) nyear_beg = ', nyear_beg 79 69 ! 80 #if defined key_diatrc && ! defined key_iomput81 70 82 ! Namelist namcfcdia 83 ! ------------------- 84 nn_writedia = 10 ! default values 71 IF( .NOT.lk_iomput .AND. ln_diatrc ) THEN 72 ! 73 ! Namelist namcfcdia 74 ! ------------------- 75 DO jl = 1, jp_cfc_2d 76 WRITE(cfcdia2d(jl)%sname,'("2D_",I1)') jl ! short name 77 WRITE(cfcdia2d(jl)%lname,'("2D DIAGNOSTIC NUMBER ",I2)') jl ! long name 78 cfcdia2d(jl)%units = ' ' ! units 79 END DO 85 80 86 DO jl = 1, jp_cfc_2d 87 jn = jp_cfc0_2d + jl - 1 88 WRITE(ctrc2d(jn),'("2D_",I1)') jn ! short name 89 WRITE(ctrc2l(jn),'("2D DIAGNOSTIC NUMBER ",I2)') jn ! long name 90 ctrc2u(jn) = ' ' ! units 91 END DO 81 REWIND( numnatc ) ! read natrtd 82 READ ( numnatc, namcfcdia ) 92 83 93 REWIND( numnatc ) ! read natrtd94 READ ( numnatc, namcfcdia )95 96 DO jl = 1, jp_cfc_2d97 jn = jp_cfc0_2d + jl - 198 ctrc2d(jn) = cfcdia2d(jl)%snamedia99 ctrc2l(jn) = cfcdia2d(jl)%lnamedia100 ctrc2u(jn) = cfcdia2d(jl)%unitdia101 END DO102 103 104 IF(lwp) THEN ! control print105 WRITE(numout,*)106 WRITE(numout,*) ' Namelist : natadd'107 WRITE(numout,*) ' frequency of outputs for additional arrays nn_writedia = ', nn_writedia108 84 DO jl = 1, jp_cfc_2d 109 85 jn = jp_cfc0_2d + jl - 1 110 WRITE(numout,*) ' 2d output field No : ',jn 111 WRITE(numout,*) ' short name : ', TRIM(ctrc2d(jn)) 112 WRITE(numout,*) ' long name : ', TRIM(ctrc2l(jn)) 113 WRITE(numout,*) ' unit : ', TRIM(ctrc2u(jn)) 86 ctrc2d(jn) = TRIM( cfcdia2d(jl)%sname ) 87 ctrc2l(jn) = TRIM( cfcdia2d(jl)%lname ) 88 ctrc2u(jn) = TRIM( cfcdia2d(jl)%units ) 89 END DO 90 91 IF(lwp) THEN ! control print 92 WRITE(numout,*) 93 WRITE(numout,*) ' Namelist : natadd' 94 DO jl = 1, jp_cfc_2d 95 jn = jp_cfc0_2d + jl - 1 96 WRITE(numout,*) ' 2d diag nb : ', jn, ' short name : ', ctrc2d(jn), & 97 & ' long name : ', ctrc2l(jn), ' unit : ', ctrc2u(jn) 98 END DO 114 99 WRITE(numout,*) ' ' 115 END DO 100 ENDIF 101 ! 116 102 ENDIF 117 #endif118 103 119 104 END SUBROUTINE trc_nam_cfc -
branches/2011/dev_r2787_LOCEAN3_TRA_TRP/NEMOGCM/NEMO/TOP_SRC/CFC/trcsms_cfc.F90
r2715 r2819 28 28 PUBLIC trc_sms_cfc_alloc ! called in trcini_cfc.F90 29 29 30 INTEGER , PUBLIC, PARAMETER :: jpyear = 150 ! temporal parameter31 30 INTEGER , PUBLIC, PARAMETER :: jphem = 2 ! parameter for the 2 hemispheres 32 INTEGER , PUBLIC :: ndate_beg ! initial calendar date (aammjj) for CFC33 INTEGER , PUBLIC :: nyear_res ! restoring time constant (year)34 INTEGER , PUBLIC :: nyear_beg ! initial year (aa)35 INTEGER , PUBLIC :: npyear ! Number of years read in CFC1112 file31 INTEGER , PUBLIC :: jpyear ! Number of years read in CFC1112 file 32 INTEGER , PUBLIC :: ndate_beg ! initial calendar date (aammjj) for CFC 33 INTEGER , PUBLIC :: nyear_res ! restoring time constant (year) 34 INTEGER , PUBLIC :: nyear_beg ! initial year (aa) 36 35 37 REAL(wp), PUBLIC, DIMENSION(jpyear,jphem, 2 ):: p_cfc ! partial hemispheric pressure for CFC36 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: p_cfc ! partial hemispheric pressure for CFC 38 37 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: xphem ! spatial interpolation factor for patm 39 38 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: qtr_cfc ! flux at surface 40 39 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: qint_cfc ! cumulative flux 40 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: patm ! atmospheric function 41 41 42 42 REAL(wp), DIMENSION(4,2) :: soa ! coefficient for solubility of CFC [mol/l/atm] … … 75 75 !! CFC concentration in pico-mol/m3 76 76 !!---------------------------------------------------------------------- 77 USE wrk_nemo, ONLY: wrk_in_use, wrk_not_released78 USE wrk_nemo, ONLY: ztrcfc => wrk_3d_1 ! use for CFC sms trend79 77 ! 80 78 INTEGER, INTENT(in) :: kt ! ocean time-step index … … 82 80 INTEGER :: ji, jj, jn, jl, jm, js 83 81 INTEGER :: iyear_beg, iyear_end 84 INTEGER :: im1, im2 82 INTEGER :: im1, im2, ierr 85 83 REAL(wp) :: ztap, zdtap 86 84 REAL(wp) :: zt1, zt2, zt3, zv2 … … 90 88 REAL(wp) :: zca_cfc ! concentration at equilibrium 91 89 REAL(wp) :: zak_cfc ! transfert coefficients 92 REAL(wp), DIMENSION(jphem,jp_cfc) :: zpatm ! atmospheric function 93 !!---------------------------------------------------------------------- 94 ! 95 IF( wrk_in_use(3, 1) ) THEN 96 CALL ctl_stop('trc_sms_cfc: requested workspace array unavailable') ; RETURN 90 REAL(wp), ALLOCATABLE, DIMENSION(:,:) :: zpatm ! atmospheric function 91 !!---------------------------------------------------------------------- 92 ! 93 ALLOCATE( zpatm(jphem,jp_cfc), STAT=ierr ) 94 IF( ierr > 0 ) THEN 95 CALL ctl_stop( 'trc_sms_cfc: unable to allocate zpatm array' ) ; RETURN 97 96 ENDIF 98 97 … … 158 157 159 158 ! Input function : speed *( conc. at equil - concen at surface ) 160 ! trn in pico-mol/l idem qtr; ak in en m/ s159 ! trn in pico-mol/l idem qtr; ak in en m/a 161 160 qtr_cfc(ji,jj,jl) = -zak_cfc * ( trb(ji,jj,1,jn) - zca_cfc ) & 162 161 #if defined key_degrad … … 164 163 #endif 165 164 & * tmask(ji,jj,1) * ( 1. - fr_i(ji,jj) ) 166 167 165 ! Add the surface flux to the trend 168 166 tra(ji,jj,1,jn) = tra(ji,jj,1,jn) + qtr_cfc(ji,jj,jl) / fse3t(ji,jj,1) … … 176 174 END DO ! end CFC loop ! 177 175 ! !----------------! 178 179 #if defined key_diatrc 180 ! Save diagnostics , just for CFC11181 # if defined key_iomput 182 CALL iom_put( "qtrCFC11" , qtr_cfc(:,:,1) )183 CALL iom_put( "qintCFC11" , qint_cfc(:,:,1) )184 # else 185 trc2d(:,:,jp_cfc0_2d ) = qtr_cfc(:,:,1)186 trc2d(:,:,jp_cfc0_2d + 1) = qint_cfc(:,:,1)187 # endif 188 #endif 189 176 IF( ln_diatrc ) THEN 177 ! 178 IF( lk_iomput ) THEN 179 CALL iom_put( "qtrCFC11" , qtr_cfc (:,:,1) ) 180 CALL iom_put( "qintCFC11" , qint_cfc(:,:,1) ) 181 ELSE 182 trc2d(:,:,jp_cfc0_2d ) = qtr_cfc (:,:,1) 183 trc2d(:,:,jp_cfc0_2d + 1) = qint_cfc(:,:,1) 184 END IF 185 ! 186 END IF 187 190 188 IF( l_trdtrc ) THEN 191 189 DO jn = jp_cfc0, jp_cfc1 192 ztrcfc(:,:,:) = tra(:,:,:,jn) 193 CALL trd_mod_trc( ztrcfc, jn, jptra_trd_sms, kt ) ! save trends 190 CALL trd_mod_trc( tra(:,:,:,jn), jn, jptra_trd_sms, kt ) ! save trends 194 191 END DO 195 192 END IF 196 !197 IF( wrk_not_released(3, 1) ) CALL ctl_stop('trc_sms_cfc: failed to release workspace array')198 193 ! 199 194 END SUBROUTINE trc_sms_cfc -
branches/2011/dev_r2787_LOCEAN3_TRA_TRP/NEMOGCM/NEMO/TOP_SRC/LOBSTER/par_lobster.F90
r2528 r2819 19 19 LOGICAL, PUBLIC, PARAMETER :: lk_lobster = .TRUE. !: LOBSTER flag 20 20 INTEGER, PUBLIC, PARAMETER :: jp_lobster = 6 !: number of LOBSTER tracers 21 INTEGER, PUBLIC, PARAMETER :: jp_lobster_2d = 19 !: additional 2d output arrays ('key_diatrc')22 INTEGER, PUBLIC, PARAMETER :: jp_lobster_3d = 3 !: additional 3d output arrays ('key_diatrc')21 INTEGER, PUBLIC, PARAMETER :: jp_lobster_2d = 19 !: additional 2d output arrays 22 INTEGER, PUBLIC, PARAMETER :: jp_lobster_3d = 3 !: additional 3d output arrays 23 23 INTEGER, PUBLIC, PARAMETER :: jp_lobster_trd = 17 !: number of sms trends for LOBSTER 24 24 -
branches/2011/dev_r2787_LOCEAN3_TRA_TRP/NEMOGCM/NEMO/TOP_SRC/LOBSTER/trcbio.F90
r2715 r2819 74 74 REAL(wp) :: zfilpz, zfildz, zphya, zzooa, zno3a 75 75 REAL(wp) :: znh4a, zdeta, zdoma, zzoobod, zboddet, zdomaju 76 #if defined key_diatrc77 76 REAL(wp) :: ze3t 78 #endif79 #if defined key_diatrc && defined key_iomput80 77 REAL(wp), POINTER, DIMENSION(:,:,:) :: zw2d 81 78 REAL(wp), POINTER, DIMENSION(:,:,:,:) :: zw3d 82 #endif83 REAL(wp), DIMENSION(:,:,:,:), ALLOCATABLE :: ztrbio84 79 CHARACTER (len=25) :: charout 85 80 !!--------------------------------------------------------------------- 86 81 87 #if defined key_diatrc && defined key_iomput 88 IF( ( wrk_in_use(3, 2) ) .OR. ( wrk_in_use(4, 1) ) ) THEN 89 CALL ctl_stop('trc_bio : requested workspace arrays unavailable.') 90 RETURN 91 END IF 92 ! Set-up pointers into sub-arrays of workspaces 93 zw2d => wrk_3d_2(:,:,1:17) 94 zw3d => wrk_4d_1(:,:,:,1:3) 95 #endif 82 IF( ln_diatrc .AND. lk_iomput ) THEN 83 IF( ( wrk_in_use(3, 2) ) .OR. ( wrk_in_use(4, 1) ) ) THEN 84 CALL ctl_stop('trc_bio : requested workspace arrays unavailable.') ; RETURN 85 END IF 86 ! Set-up pointers into sub-arrays of workspaces 87 zw2d => wrk_3d_2(:,:,1:17) 88 zw3d => wrk_4d_1(:,:,:,1:3) 89 ENDIF 96 90 97 91 IF( kt == nit000 ) THEN … … 102 96 103 97 fbod(:,:) = 0.e0 104 #if defined key_diatrc && ! defined key_iomput 105 # if defined key_iomput 106 zw2d (:,:,:) = 0.e0 107 zw3d(:,:,:,:) = 0.e0 108 # else 109 DO jl = jp_lob0_2d, jp_lob1_2d 110 trc2d(:,:,jl) = 0.e0 111 END DO 112 # endif 113 #endif 114 115 IF( l_trdtrc )THEN 116 ALLOCATE( ztrbio(jpi,jpj,jpk,jp_lobster_trd) ) 117 ztrbio(:,:,:,:) = 0. 118 ENDIF 119 120 ! ! -------------------------- ! 121 DO jk = 1, jpkbm1 ! Upper ocean (bio-layers) ! 122 ! ! -------------------------- ! 98 IF( ln_diatrc ) THEN 99 ! 100 IF( lk_iomput ) THEN 101 zw2d (:,:,:) = 0.e0 102 zw3d(:,:,:,:) = 0.e0 103 ELSE 104 trc2d(:,:, jp_lob0_2d:jp_lob1_2d) = 0.e0 105 trc3d(:,:,:,jp_lob0_3d:jp_lob1_3d) = 0.e0 106 ENDIF 107 ! 108 ENDIF 109 110 DO jk = 1, jpkm1 111 ! 123 112 DO jj = 2, jpjm1 124 113 DO ji = fs_2, fs_jpim1 … … 133 122 znh4 = MAX( 0.e0, trn(ji,jj,jk,jp_lob_nh4) ) 134 123 zdom = MAX( 0.e0, trn(ji,jj,jk,jp_lob_dom) ) 135 136 ! Limitations 137 zlt = 1. 138 zle = 1. - EXP( -xpar(ji,jj,jk) / aki / zlt ) 139 ! psinut,akno3,aknh4 added by asklod AS Kremeur 2005-03 140 zlno3 = zno3 * EXP( -psinut * znh4 ) / ( akno3 + zno3 ) 141 zlnh4 = znh4 / (znh4+aknh4) 142 143 ! sinks and sources 144 ! phytoplankton production and exsudation 145 zno3phy = tmumax * zle * zlt * zlno3 * zphy 146 znh4phy = tmumax * zle * zlt * zlnh4 * zphy 147 148 ! fphylab added by asklod AS Kremeur 2005-03 149 zphydom = rgamma * (1 - fphylab) * (zno3phy + znh4phy) 150 zphynh4 = rgamma * fphylab * (zno3phy + znh4phy) 151 152 ! zooplankton production 153 ! preferences 154 zppz = rppz 155 zpdz = 1. - rppz 156 zpppz = ( zppz * zphy ) / ( ( zppz * zphy + zpdz * zdet ) + 1.e-13 ) 157 zppdz = ( zpdz * zdet ) / ( ( zppz * zphy + zpdz * zdet ) + 1.e-13 ) 158 zfood = zpppz * zphy + zppdz * zdet 159 ! filtration 160 zfilpz = taus * zpppz / (aks + zfood) 161 zfildz = taus * zppdz / (aks + zfood) 162 ! grazing 163 zphyzoo = zfilpz * zphy * zzoo 164 zdetzoo = zfildz * zdet * zzoo 165 166 ! fecal pellets production 167 zzoodet = rpnaz * zphyzoo + rdnaz * zdetzoo 124 ! ! -------------------------- ! 125 IF( jk <= jpkbm1 ) THEN ! Upper ocean (bio-layers) ! 126 ! ! -------------------------- ! 127 ! Limitations 128 zlt = 1. 129 zle = 1. - EXP( -xpar(ji,jj,jk) / aki / zlt ) 130 ! psinut,akno3,aknh4 added by asklod AS Kremeur 2005-03 131 zlno3 = zno3 * EXP( -psinut * znh4 ) / ( akno3 + zno3 ) 132 zlnh4 = znh4 / (znh4+aknh4) 133 134 ! sinks and sources 135 ! phytoplankton production and exsudation 136 zno3phy = tmumax * zle * zlt * zlno3 * zphy 137 znh4phy = tmumax * zle * zlt * zlnh4 * zphy 138 139 ! fphylab added by asklod AS Kremeur 2005-03 140 zphydom = rgamma * (1 - fphylab) * (zno3phy + znh4phy) 141 zphynh4 = rgamma * fphylab * (zno3phy + znh4phy) 142 143 ! zooplankton production 144 ! preferences 145 zppz = rppz 146 zpdz = 1. - rppz 147 zpppz = ( zppz * zphy ) / ( ( zppz * zphy + zpdz * zdet ) + 1.e-13 ) 148 zppdz = ( zpdz * zdet ) / ( ( zppz * zphy + zpdz * zdet ) + 1.e-13 ) 149 zfood = zpppz * zphy + zppdz * zdet 150 ! filtration 151 zfilpz = taus * zpppz / (aks + zfood) 152 zfildz = taus * zppdz / (aks + zfood) 153 ! grazing zphyzoo = zfilpz * zphy * zzoo 154 zdetzoo = zfildz * zdet * zzoo 155 156 ! fecal pellets production 157 zzoodet = rpnaz * zphyzoo + rdnaz * zdetzoo 168 158 169 ! zooplankton liquide excretion 170 zzoonh4 = tauzn * fzoolab * zzoo 171 zzoodom = tauzn * (1 - fzoolab) * zzoo 172 173 ! mortality 174 ! phytoplankton mortality 175 zphydet = tmminp * zphy 176 177 ! zooplankton mortality 178 ! closure : flux fbod is redistributed below level jpkbio 179 zzoobod = tmminz * zzoo * zzoo 180 fbod(ji,jj) = fbod(ji,jj) + (1-fdbod) * zzoobod * fse3t(ji,jj,jk) 181 zboddet = fdbod * zzoobod 182 183 ! detritus and dom breakdown 184 zdetnh4 = taudn * fdetlab * zdet 185 zdetdom = taudn * (1 - fdetlab) * zdet 186 187 zdomnh4 = taudomn * zdom 188 189 ! flux added to express how the excess of nitrogen from 190 ! PHY, ZOO and DET to DOM goes directly to NH4 (flux of ajustment) 191 zdomaju = (1 - redf/reddom) * (zphydom + zzoodom + zdetdom) 192 193 ! Nitrification 194 znh4no3 = taunn * znh4 159 ! zooplankton liquide excretion 160 zzoonh4 = tauzn * fzoolab * zzoo 161 zzoodom = tauzn * (1 - fzoolab) * zzoo 162 163 ! mortality 164 ! phytoplankton mortality 165 zphydet = tmminp * zphy 166 167 ! zooplankton mortality 168 ! closure : flux fbod is redistributed below level jpkbio 169 zzoobod = tmminz * zzoo * zzoo 170 fbod(ji,jj) = fbod(ji,jj) + (1-fdbod) * zzoobod * fse3t(ji,jj,jk) 171 zboddet = fdbod * zzoobod 172 173 ! detritus and dom breakdown 174 zdetnh4 = taudn * fdetlab * zdet 175 zdetdom = taudn * (1 - fdetlab) * zdet 176 177 zdomnh4 = taudomn * zdom 178 179 ! flux added to express how the excess of nitrogen from 180 ! PHY, ZOO and DET to DOM goes directly to NH4 (flux of ajustment) 181 zdomaju = (1 - redf/reddom) * (zphydom + zzoodom + zdetdom) 182 183 ! Nitrification 184 znh4no3 = taunn * znh4 185 ! ! -------------------------- ! 186 ELSE ! Lower ocean ! 187 ! ! -------------------------- ! 188 ! Limitations 189 zlt = 0.e0 190 zle = 0.e0 191 zlno3 = 0.e0 192 zlnh4 = 0.e0 193 194 ! sinks and sources 195 ! phytoplankton production and exsudation 196 zno3phy = 0.e0 197 znh4phy = 0.e0 198 zphydom = 0.e0 199 zphynh4 = 0.e0 200 201 ! zooplankton production 202 zphyzoo = 0.e0 ! grazing 203 zdetzoo = 0.e0 204 205 zzoodet = 0.e0 ! fecal pellets production 206 207 zzoonh4 = tauzn * fzoolab * zzoo ! zooplankton liquide excretion 208 zzoodom = tauzn * (1 - fzoolab) * zzoo 209 210 ! mortality 211 zphydet = tmminp * zphy ! phytoplankton mortality 212 213 zzoobod = 0.e0 ! zooplankton mortality 214 zboddet = 0.e0 ! closure : flux fbod is redistributed below level jpkbio 215 216 ! detritus and dom breakdown 217 zdetnh4 = taudn * fdetlab * zdet 218 zdetdom = taudn * (1 - fdetlab) * zdet 219 220 zdomnh4 = taudomn * zdom 221 zdomaju = (1 - redf/reddom) * (zphydom + zzoodom + zdetdom) 222 223 ! Nitrification 224 znh4no3 = taunn * znh4 225 ! 226 ENDIF 195 227 196 228 ! determination of trends … … 211 243 tra(ji,jj,jk,jp_lob_dom) = tra(ji,jj,jk,jp_lob_dom) + zdoma 212 244 213 #if defined key_diabio 214 trbio(ji,jj,jk,jp_lob0_trd ) = zno3phy 215 trbio(ji,jj,jk,jp_lob0_trd + 1) = znh4phy 216 trbio(ji,jj,jk,jp_lob0_trd + 2) = zphynh4 217 trbio(ji,jj,jk,jp_lob0_trd + 3) = zphydom 218 trbio(ji,jj,jk,jp_lob0_trd + 4) = zphyzoo 219 trbio(ji,jj,jk,jp_lob0_trd + 5) = zphydet 220 trbio(ji,jj,jk,jp_lob0_trd + 6) = zdetzoo 221 trbio(ji,jj,jk,jp_lob0_trd + 8) = zzoodet 222 trbio(ji,jj,jk,jp_lob0_trd + 9) = zzoobod 223 trbio(ji,jj,jk,jp_lob0_trd + 10) = zzoonh4 224 trbio(ji,jj,jk,jp_lob0_trd + 11) = zzoodom 225 trbio(ji,jj,jk,jp_lob0_trd + 12) = znh4no3 226 trbio(ji,jj,jk,jp_lob0_trd + 13) = zdomnh4 227 trbio(ji,jj,jk,jp_lob0_trd + 14) = zdetnh4 228 trbio(ji,jj,jk,jp_lob0_trd + 15) = zdetdom 229 #endif 230 IF( l_trdtrc ) THEN 231 ztrbio(ji,jj,jk,jp_lob0_trd ) = zno3phy 232 ztrbio(ji,jj,jk,jp_lob0_trd + 1) = znh4phy 233 ztrbio(ji,jj,jk,jp_lob0_trd + 2) = zphynh4 234 ztrbio(ji,jj,jk,jp_lob0_trd + 3) = zphydom 235 ztrbio(ji,jj,jk,jp_lob0_trd + 4) = zphyzoo 236 ztrbio(ji,jj,jk,jp_lob0_trd + 5) = zphydet 237 ztrbio(ji,jj,jk,jp_lob0_trd + 6) = zdetzoo 245 IF( ( ln_diabio .AND. .NOT. lk_iomput ) .OR. l_trdtrc ) THEN 246 trbio(ji,jj,jk,jp_lob0_trd ) = zno3phy 247 trbio(ji,jj,jk,jp_lob0_trd + 1) = znh4phy 248 trbio(ji,jj,jk,jp_lob0_trd + 2) = zphynh4 249 trbio(ji,jj,jk,jp_lob0_trd + 3) = zphydom 250 trbio(ji,jj,jk,jp_lob0_trd + 4) = zphyzoo 251 trbio(ji,jj,jk,jp_lob0_trd + 5) = zphydet 252 trbio(ji,jj,jk,jp_lob0_trd + 6) = zdetzoo 238 253 ! trend number 8 in trcsed 239 ztrbio(ji,jj,jk,jp_lob0_trd + 8) = zzoodet240 ztrbio(ji,jj,jk,jp_lob0_trd + 9) = zzoobod241 ztrbio(ji,jj,jk,jp_lob0_trd + 10) = zzoonh4242 ztrbio(ji,jj,jk,jp_lob0_trd + 11) = zzoodom243 ztrbio(ji,jj,jk,jp_lob0_trd + 12) = znh4no3244 ztrbio(ji,jj,jk,jp_lob0_trd + 13) = zdomnh4245 ztrbio(ji,jj,jk,jp_lob0_trd + 14) = zdetnh4246 ztrbio(ji,jj,jk,jp_lob0_trd + 15) = zdetdom254 trbio(ji,jj,jk,jp_lob0_trd + 8) = zzoodet 255 trbio(ji,jj,jk,jp_lob0_trd + 9) = zzoobod 256 trbio(ji,jj,jk,jp_lob0_trd + 10) = zzoonh4 257 trbio(ji,jj,jk,jp_lob0_trd + 11) = zzoodom 258 trbio(ji,jj,jk,jp_lob0_trd + 12) = znh4no3 259 trbio(ji,jj,jk,jp_lob0_trd + 13) = zdomnh4 260 trbio(ji,jj,jk,jp_lob0_trd + 14) = zdetnh4 261 trbio(ji,jj,jk,jp_lob0_trd + 15) = zdetdom 247 262 ! trend number 17 in trcexp 248 263 ENDIF 249 264 250 #if defined key_diatrc 251 ! convert fluxes in per day 252 ze3t = fse3t(ji,jj,jk) * 86400. 253 #if ! defined key_iomput 254 trc2d(ji,jj,jp_lob0_2d ) = trc2d(ji,jj, jp_lob0_2d ) + zno3phy * ze3t 255 trc2d(ji,jj,jp_lob0_2d + 1) = trc2d(ji,jj, jp_lob0_2d + 1) + znh4phy * ze3t 256 trc2d(ji,jj,jp_lob0_2d + 2) = trc2d(ji,jj, jp_lob0_2d + 2) + zphydom * ze3t 257 trc2d(ji,jj,jp_lob0_2d + 3) = trc2d(ji,jj, jp_lob0_2d + 3) + zphynh4 * ze3t 258 trc2d(ji,jj,jp_lob0_2d + 4) = trc2d(ji,jj, jp_lob0_2d + 4) + zphyzoo * ze3t 259 trc2d(ji,jj,jp_lob0_2d + 5) = trc2d(ji,jj, jp_lob0_2d + 5) + zphydet * ze3t 260 trc2d(ji,jj,jp_lob0_2d + 6) = trc2d(ji,jj, jp_lob0_2d + 6) + zdetzoo * ze3t 261 ! trend number 8 is in trcsed.F 262 trc2d(ji,jj,jp_lob0_2d + 8) = trc2d(ji,jj,jp_lob0_2d + 8) + zzoodet * ze3t 263 trc2d(ji,jj,jp_lob0_2d + 9) = trc2d(ji,jj,jp_lob0_2d + 9) + zzoobod * ze3t 264 trc2d(ji,jj,jp_lob0_2d + 10) = trc2d(ji,jj,jp_lob0_2d + 10) + zzoonh4 * ze3t 265 trc2d(ji,jj,jp_lob0_2d + 11) = trc2d(ji,jj,jp_lob0_2d + 11) + zzoodom * ze3t 266 trc2d(ji,jj,jp_lob0_2d + 12) = trc2d(ji,jj,jp_lob0_2d + 12) + znh4no3 * ze3t 267 trc2d(ji,jj,jp_lob0_2d + 13) = trc2d(ji,jj,jp_lob0_2d + 13) + zdomnh4 * ze3t 268 trc2d(ji,jj,jp_lob0_2d + 14) = trc2d(ji,jj,jp_lob0_2d + 14) + zdetnh4 * ze3t 269 trc2d(ji,jj,jp_lob0_2d + 15) = trc2d(ji,jj,jp_lob0_2d + 15) + ( zno3phy + znh4phy - zphynh4 & 270 & - zphydom - zphyzoo - zphydet ) * ze3t 271 trc2d(ji,jj,jp_lob0_2d + 16) = trc2d(ji,jj,jp_lob0_2d + 16) + ( zphyzoo + zdetzoo - zzoodet & 272 & - zzoobod - zzoonh4 - zzoodom ) * ze3t 273 trc2d(ji,jj,jp_lob0_2d + 17) = trc2d(ji,jj,jp_lob0_2d + 17) + zdetdom * ze3t 274 ! trend number 19 is in trcexp.F 275 #else 276 zw2d(ji,jj,1) = zw2d(ji,jj,1) + zno3phy * ze3t 277 zw2d(ji,jj,2) = zw2d(ji,jj,2) + znh4phy * ze3t 278 zw2d(ji,jj,3) = zw2d(ji,jj,3) + zphydom * ze3t 279 zw2d(ji,jj,4) = zw2d(ji,jj,4) + zphynh4 * ze3t 280 zw2d(ji,jj,5) = zw2d(ji,jj,5) + zphyzoo * ze3t 281 zw2d(ji,jj,6) = zw2d(ji,jj,6) + zphydet * ze3t 282 zw2d(ji,jj,7) = zw2d(ji,jj,7) + zdetzoo * ze3t 283 zw2d(ji,jj,8) = zw2d(ji,jj,8) + zzoodet * ze3t 284 zw2d(ji,jj,9) = zw2d(ji,jj,9) + zzoobod * ze3t 285 zw2d(ji,jj,10) = zw2d(ji,jj,10) + zzoonh4 * ze3t 286 zw2d(ji,jj,11) = zw2d(ji,jj,11) + zzoodom * ze3t 287 zw2d(ji,jj,12) = zw2d(ji,jj,12) + znh4no3 * ze3t 288 zw2d(ji,jj,13) = zw2d(ji,jj,13) + zdomnh4 * ze3t 289 zw2d(ji,jj,14) = zw2d(ji,jj,14) + zdetnh4 * ze3t 290 zw2d(ji,jj,15) = zw2d(ji,jj,15) + ( zno3phy + znh4phy - zphynh4 - zphydom - zphyzoo - zphydet ) * ze3t 291 zw2d(ji,jj,16) = zw2d(ji,jj,16) + ( zphyzoo + zdetzoo - zzoodet - zzoobod - zzoonh4 - zzoodom ) * ze3t 292 zw2d(ji,jj,17) = zw2d(ji,jj,17) + zdetdom * ze3t 293 #endif 294 #if defined key_diatrc 295 # if ! defined key_iomput 296 trc3d(ji,jj,jk,jp_lob0_3d ) = zno3phy * 86400 297 trc3d(ji,jj,jk,jp_lob0_3d + 1) = znh4phy * 86400 298 trc3d(ji,jj,jk,jp_lob0_3d + 2) = znh4no3 * 86400 299 # else 300 zw3d(ji,jj,jk,1) = zno3phy * 86400 301 zw3d(ji,jj,jk,2) = znh4phy * 86400 302 zw3d(ji,jj,jk,3) = znh4no3 * 86400 303 # endif 304 #endif 305 #endif 265 IF( ln_diatrc ) THEN 266 ! convert fluxes in per day 267 ze3t = fse3t(ji,jj,jk) * 86400. 268 IF( lk_iomput ) THEN 269 zw2d(ji,jj,1) = zw2d(ji,jj,1) + zno3phy * ze3t 270 zw2d(ji,jj,2) = zw2d(ji,jj,2) + znh4phy * ze3t 271 zw2d(ji,jj,3) = zw2d(ji,jj,3) + zphydom * ze3t 272 zw2d(ji,jj,4) = zw2d(ji,jj,4) + zphynh4 * ze3t 273 zw2d(ji,jj,5) = zw2d(ji,jj,5) + zphyzoo * ze3t 274 zw2d(ji,jj,6) = zw2d(ji,jj,6) + zphydet * ze3t 275 zw2d(ji,jj,7) = zw2d(ji,jj,7) + zdetzoo * ze3t 276 zw2d(ji,jj,8) = zw2d(ji,jj,8) + zzoodet * ze3t 277 zw2d(ji,jj,9) = zw2d(ji,jj,9) + zzoobod * ze3t 278 zw2d(ji,jj,10) = zw2d(ji,jj,10) + zzoonh4 * ze3t 279 zw2d(ji,jj,11) = zw2d(ji,jj,11) + zzoodom * ze3t 280 zw2d(ji,jj,12) = zw2d(ji,jj,12) + znh4no3 * ze3t 281 zw2d(ji,jj,13) = zw2d(ji,jj,13) + zdomnh4 * ze3t 282 zw2d(ji,jj,14) = zw2d(ji,jj,14) + zdetnh4 * ze3t 283 zw2d(ji,jj,15) = zw2d(ji,jj,15) + ( zno3phy + znh4phy - zphynh4 - zphydom - zphyzoo - zphydet ) * ze3t 284 zw2d(ji,jj,16) = zw2d(ji,jj,16) + ( zphyzoo + zdetzoo - zzoodet - zzoobod - zzoonh4 - zzoodom ) * ze3t 285 zw2d(ji,jj,17) = zw2d(ji,jj,17) + zdetdom * ze3t 286 ! 287 zw3d(ji,jj,jk,1) = zno3phy * 86400 288 zw3d(ji,jj,jk,2) = znh4phy * 86400 289 zw3d(ji,jj,jk,3) = znh4no3 * 86400 290 ELSE 291 trc2d(ji,jj,jp_lob0_2d ) = trc2d(ji,jj, jp_lob0_2d ) + zno3phy * ze3t 292 trc2d(ji,jj,jp_lob0_2d + 1) = trc2d(ji,jj, jp_lob0_2d + 1) + znh4phy * ze3t 293 trc2d(ji,jj,jp_lob0_2d + 2) = trc2d(ji,jj, jp_lob0_2d + 2) + zphydom * ze3t 294 trc2d(ji,jj,jp_lob0_2d + 3) = trc2d(ji,jj, jp_lob0_2d + 3) + zphynh4 * ze3t 295 trc2d(ji,jj,jp_lob0_2d + 4) = trc2d(ji,jj, jp_lob0_2d + 4) + zphyzoo * ze3t 296 trc2d(ji,jj,jp_lob0_2d + 5) = trc2d(ji,jj, jp_lob0_2d + 5) + zphydet * ze3t 297 trc2d(ji,jj,jp_lob0_2d + 6) = trc2d(ji,jj, jp_lob0_2d + 6) + zdetzoo * ze3t 298 ! trend number 8 is in trcsed.F 299 trc2d(ji,jj,jp_lob0_2d + 8) = trc2d(ji,jj,jp_lob0_2d + 8) + zzoodet * ze3t 300 trc2d(ji,jj,jp_lob0_2d + 9) = trc2d(ji,jj,jp_lob0_2d + 9) + zzoobod * ze3t 301 trc2d(ji,jj,jp_lob0_2d + 10) = trc2d(ji,jj,jp_lob0_2d + 10) + zzoonh4 * ze3t 302 trc2d(ji,jj,jp_lob0_2d + 11) = trc2d(ji,jj,jp_lob0_2d + 11) + zzoodom * ze3t 303 trc2d(ji,jj,jp_lob0_2d + 12) = trc2d(ji,jj,jp_lob0_2d + 12) + znh4no3 * ze3t 304 trc2d(ji,jj,jp_lob0_2d + 13) = trc2d(ji,jj,jp_lob0_2d + 13) + zdomnh4 * ze3t 305 trc2d(ji,jj,jp_lob0_2d + 14) = trc2d(ji,jj,jp_lob0_2d + 14) + zdetnh4 * ze3t 306 trc2d(ji,jj,jp_lob0_2d + 15) = trc2d(ji,jj,jp_lob0_2d + 15) + ( zno3phy + znh4phy - zphynh4 & 307 & - zphydom - zphyzoo - zphydet ) * ze3t 308 trc2d(ji,jj,jp_lob0_2d + 16) = trc2d(ji,jj,jp_lob0_2d + 16) + ( zphyzoo + zdetzoo - zzoodet & 309 & - zzoobod - zzoonh4 - zzoodom ) * ze3t 310 trc2d(ji,jj,jp_lob0_2d + 17) = trc2d(ji,jj,jp_lob0_2d + 17) + zdetdom * ze3t 311 ! trend number 19 is in trcexp.F 312 trc3d(ji,jj,jk,jp_lob0_3d ) = zno3phy * 86400 313 trc3d(ji,jj,jk,jp_lob0_3d + 1) = znh4phy * 86400 314 trc3d(ji,jj,jk,jp_lob0_3d + 2) = znh4no3 * 86400 315 ! 316 ENDIF 317 ! 318 ENDIF 306 319 END DO 307 320 END DO 308 321 END DO 309 322 310 ! ! -------------------------- ! 311 DO jk = jpkb, jpkm1 ! Upper ocean (bio-layers) ! 312 ! ! -------------------------- ! 313 DO jj = 2, jpjm1 314 DO ji = fs_2, fs_jpim1 315 ! remineralisation of all quantities towards nitrate 316 317 ! trophic variables( det, zoo, phy, no3, nh4, dom) 318 ! negative trophic variables DO not contribute to the fluxes 319 zdet = MAX( 0.e0, trn(ji,jj,jk,jp_lob_det) ) 320 zzoo = MAX( 0.e0, trn(ji,jj,jk,jp_lob_zoo) ) 321 zphy = MAX( 0.e0, trn(ji,jj,jk,jp_lob_phy) ) 322 zno3 = MAX( 0.e0, trn(ji,jj,jk,jp_lob_no3) ) 323 znh4 = MAX( 0.e0, trn(ji,jj,jk,jp_lob_nh4) ) 324 zdom = MAX( 0.e0, trn(ji,jj,jk,jp_lob_dom) ) 325 326 ! Limitations 327 zlt = 0.e0 328 zle = 0.e0 329 zlno3 = 0.e0 330 zlnh4 = 0.e0 331 332 ! sinks and sources 333 ! phytoplankton production and exsudation 334 zno3phy = 0.e0 335 znh4phy = 0.e0 336 zphydom = 0.e0 337 zphynh4 = 0.e0 338 339 ! zooplankton production 340 zphyzoo = 0.e0 ! grazing 341 zdetzoo = 0.e0 342 343 zzoodet = 0.e0 ! fecal pellets production 344 345 zzoonh4 = tauzn * fzoolab * zzoo ! zooplankton liquide excretion 346 zzoodom = tauzn * (1 - fzoolab) * zzoo 347 348 ! mortality 349 zphydet = tmminp * zphy ! phytoplankton mortality 350 351 zzoobod = 0.e0 ! zooplankton mortality 352 zboddet = 0.e0 ! closure : flux fbod is redistributed below level jpkbio 353 354 ! detritus and dom breakdown 355 zdetnh4 = taudn * fdetlab * zdet 356 zdetdom = taudn * (1 - fdetlab) * zdet 357 358 zdomnh4 = taudomn * zdom 359 zdomaju = (1 - redf/reddom) * (zphydom + zzoodom + zdetdom) 360 361 ! Nitrification 362 znh4no3 = taunn * znh4 363 364 365 ! determination of trends 366 ! total trend for each biological tracer 367 zphya = zno3phy + znh4phy - zphynh4 - zphydom - zphyzoo - zphydet 368 zzooa = zphyzoo + zdetzoo - zzoodet - zzoodom - zzoonh4 - zzoobod 369 zno3a = - zno3phy + znh4no3 370 znh4a = - znh4phy - znh4no3 + zphynh4 + zzoonh4 + zdomnh4 + zdetnh4 + zdomaju 371 zdeta = zphydet + zzoodet - zdetzoo - zdetnh4 - zdetdom + zboddet 372 zdoma = zphydom + zzoodom + zdetdom - zdomnh4 - zdomaju 373 374 ! tracer flux at totox-point added to the general trend 375 tra(ji,jj,jk,jp_lob_det) = tra(ji,jj,jk,jp_lob_det) + zdeta 376 tra(ji,jj,jk,jp_lob_zoo) = tra(ji,jj,jk,jp_lob_zoo) + zzooa 377 tra(ji,jj,jk,jp_lob_phy) = tra(ji,jj,jk,jp_lob_phy) + zphya 378 tra(ji,jj,jk,jp_lob_no3) = tra(ji,jj,jk,jp_lob_no3) + zno3a 379 tra(ji,jj,jk,jp_lob_nh4) = tra(ji,jj,jk,jp_lob_nh4) + znh4a 380 tra(ji,jj,jk,jp_lob_dom) = tra(ji,jj,jk,jp_lob_dom) + zdoma 381 ! 382 #if defined key_diabio 383 trbio(ji,jj,jk,jp_lob0_trd ) = zno3phy 384 trbio(ji,jj,jk,jp_lob0_trd + 1) = znh4phy 385 trbio(ji,jj,jk,jp_lob0_trd + 2) = zphynh4 386 trbio(ji,jj,jk,jp_lob0_trd + 3) = zphydom 387 trbio(ji,jj,jk,jp_lob0_trd + 4) = zphyzoo 388 trbio(ji,jj,jk,jp_lob0_trd + 5) = zphydet 389 trbio(ji,jj,jk,jp_lob0_trd + 6) = zdetzoo 390 trbio(ji,jj,jk,jp_lob0_trd + 8) = zzoodet 391 trbio(ji,jj,jk,jp_lob0_trd + 9) = zzoobod 392 trbio(ji,jj,jk,jp_lob0_trd + 10) = zzoonh4 393 trbio(ji,jj,jk,jp_lob0_trd + 11) = zzoodom 394 trbio(ji,jj,jk,jp_lob0_trd + 12) = znh4no3 395 trbio(ji,jj,jk,jp_lob0_trd + 13) = zdomnh4 396 trbio(ji,jj,jk,jp_lob0_trd + 14) = zdetnh4 397 trbio(ji,jj,jk,jp_lob0_trd + 15) = zdetdom 398 #endif 399 IF( l_trdtrc ) THEN 400 ztrbio(ji,jj,jk,jp_lob0_trd ) = zno3phy 401 ztrbio(ji,jj,jk,jp_lob0_trd + 1) = znh4phy 402 ztrbio(ji,jj,jk,jp_lob0_trd + 2) = zphynh4 403 ztrbio(ji,jj,jk,jp_lob0_trd + 3) = zphydom 404 ztrbio(ji,jj,jk,jp_lob0_trd + 4) = zphyzoo 405 ztrbio(ji,jj,jk,jp_lob0_trd + 5) = zphydet 406 ztrbio(ji,jj,jk,jp_lob0_trd + 6) = zdetzoo 407 ! trend number 8 in trcsed 408 ztrbio(ji,jj,jk,jp_lob0_trd + 8) = zzoodet 409 ztrbio(ji,jj,jk,jp_lob0_trd + 9) = zzoobod 410 ztrbio(ji,jj,jk,jp_lob0_trd + 10) = zzoonh4 411 ztrbio(ji,jj,jk,jp_lob0_trd + 11) = zzoodom 412 ztrbio(ji,jj,jk,jp_lob0_trd + 12) = znh4no3 413 ztrbio(ji,jj,jk,jp_lob0_trd + 13) = zdomnh4 414 ztrbio(ji,jj,jk,jp_lob0_trd + 14) = zdetnh4 415 ztrbio(ji,jj,jk,jp_lob0_trd + 15) = zdetdom 416 ! trend number 17 in trcexp 417 ENDIF 418 #if defined key_diatrc 419 # if ! defined key_iomput 420 trc3d(ji,jj,jk,jp_lob0_3d ) = zno3phy * 86400 421 trc3d(ji,jj,jk,jp_lob0_3d + 1) = znh4phy * 86400 422 trc3d(ji,jj,jk,jp_lob0_3d + 2) = znh4no3 * 86400 423 # else 424 zw3d(ji,jj,jk,1) = zno3phy * 86400 425 zw3d(ji,jj,jk,2) = znh4phy * 86400 426 zw3d(ji,jj,jk,3) = znh4no3 * 86400 427 # endif 428 #endif 323 IF( ln_diatrc ) THEN 324 ! 325 IF( lk_iomput ) THEN 326 DO jl = 1, 17 327 CALL lbc_lnk( zw2d(:,:,jl),'T', 1. ) 429 328 END DO 430 END DO 431 END DO 432 433 #if defined key_diatrc 434 ! Lateral boundary conditions 435 # if ! defined key_iomput 436 DO jl = jp_lob0_2d, jp_lob1_2d 437 CALL lbc_lnk( trc2d(:,:,jl),'T', 1. ) 438 END DO 439 # else 440 DO jl = 1, 17 441 CALL lbc_lnk( zw2d(:,:,jl),'T', 1. ) 442 END DO 443 ! Save diagnostics 444 CALL iom_put( "TNO3PHY", zw2d(:,:,1) ) 445 CALL iom_put( "TNH4PHY", zw2d(:,:,2) ) 446 CALL iom_put( "TPHYDOM", zw2d(:,:,3) ) 447 CALL iom_put( "TPHYNH4", zw2d(:,:,4) ) 448 CALL iom_put( "TPHYZOO", zw2d(:,:,5) ) 449 CALL iom_put( "TPHYDET", zw2d(:,:,6) ) 450 CALL iom_put( "TDETZOO", zw2d(:,:,7) ) 451 CALL iom_put( "TZOODET", zw2d(:,:,8) ) 452 CALL iom_put( "TZOOBOD", zw2d(:,:,9) ) 453 CALL iom_put( "TZOONH4", zw2d(:,:,10) ) 454 CALL iom_put( "TZOODOM", zw2d(:,:,11) ) 455 CALL iom_put( "TNH4NO3", zw2d(:,:,12) ) 456 CALL iom_put( "TDOMNH4", zw2d(:,:,13) ) 457 CALL iom_put( "TDETNH4", zw2d(:,:,14) ) 458 CALL iom_put( "TPHYTOT", zw2d(:,:,15) ) 459 CALL iom_put( "TZOOTOT", zw2d(:,:,16) ) 460 CALL iom_put( "TDETDOM", zw2d(:,:,17) ) 461 # endif 462 #endif 463 464 #if defined key_diatrc 465 ! Lateral boundary conditions 466 # if ! defined key_iomput 467 DO jl = jp_lob0_3d, jp_lob1_3d 468 CALL lbc_lnk( trc3d(:,:,1,jl),'T', 1. ) 469 END DO 470 # else 471 DO jl = 1, 3 472 CALL lbc_lnk( zw3d(:,:,:,jl),'T', 1. ) 473 END DO 474 ! save diagnostics 475 CALL iom_put( "FNO3PHY", zw3d(:,:,:,1) ) 476 CALL iom_put( "FNH4PHY", zw3d(:,:,:,2) ) 477 CALL iom_put( "FNH4NO3", zw3d(:,:,:,3) ) 478 # endif 479 #endif 480 481 #if defined key_diabio 482 ! Lateral boundary conditions on trcbio 483 DO jl = jp_lob0_trd, jp_lob1_trd 484 CALL lbc_lnk( trbio(:,:,1,jl),'T', 1. ) 485 END DO 486 #endif 329 DO jl = 1, 3 330 CALL lbc_lnk( zw3d(:,:,:,jl),'T', 1. ) 331 END DO 332 ! Save diagnostics 333 CALL iom_put( "TNO3PHY", zw2d(:,:,1) ) 334 CALL iom_put( "TNH4PHY", zw2d(:,:,2) ) 335 CALL iom_put( "TPHYDOM", zw2d(:,:,3) ) 336 CALL iom_put( "TPHYNH4", zw2d(:,:,4) ) 337 CALL iom_put( "TPHYZOO", zw2d(:,:,5) ) 338 CALL iom_put( "TPHYDET", zw2d(:,:,6) ) 339 CALL iom_put( "TDETZOO", zw2d(:,:,7) ) 340 CALL iom_put( "TZOODET", zw2d(:,:,8) ) 341 CALL iom_put( "TZOOBOD", zw2d(:,:,9) ) 342 CALL iom_put( "TZOONH4", zw2d(:,:,10) ) 343 CALL iom_put( "TZOODOM", zw2d(:,:,11) ) 344 CALL iom_put( "TNH4NO3", zw2d(:,:,12) ) 345 CALL iom_put( "TDOMNH4", zw2d(:,:,13) ) 346 CALL iom_put( "TDETNH4", zw2d(:,:,14) ) 347 CALL iom_put( "TPHYTOT", zw2d(:,:,15) ) 348 CALL iom_put( "TZOOTOT", zw2d(:,:,16) ) 349 ! 350 CALL iom_put( "FNO3PHY", zw3d(:,:,:,1) ) 351 CALL iom_put( "FNH4PHY", zw3d(:,:,:,2) ) 352 CALL iom_put( "FNH4NO3", zw3d(:,:,:,3) ) 353 ! 354 ELSE 355 ! 356 DO jl = jp_lob0_2d, jp_lob1_2d 357 CALL lbc_lnk( trc2d(:,:,jl),'T', 1. ) 358 END DO 359 ! 360 DO jl = jp_lob0_3d, jp_lob1_3d 361 CALL lbc_lnk( trc3d(:,:,1,jl),'T', 1. ) 362 END DO 363 ! 364 ENDIF 365 ! 366 ENDIF 367 368 IF( ln_diabio .AND. .NOT. lk_iomput ) THEN 369 DO jl = jp_lob0_trd, jp_lob1_trd 370 CALL lbc_lnk( trbio(:,:,1,jl),'T', 1. ) 371 END DO 372 ENDIF 487 373 ! 488 374 IF( l_trdtrc ) THEN 489 375 DO jl = jp_lob0_trd, jp_lob1_trd 490 CALL trd_mod_trc( ztrbio(:,:,:,jl), jl, kt ) ! handle the trend376 CALL trd_mod_trc( trbio(:,:,:,jl), jl, kt ) ! handle the trend 491 377 END DO 492 378 ENDIF 493 494 IF( l_trdtrc ) DEALLOCATE( ztrbio )495 379 496 380 IF(ln_ctl) THEN ! print mean trends (used for debugging) … … 500 384 ENDIF 501 385 ! 502 #if defined key_diatrc && defined key_iomput 503 IF( ( wrk_not_released(3, 2) ) .OR. ( wrk_not_released(4, 1) ) ) &504 & CALL ctl_stop('trc_bio : failed to release workspace arrays.')505 #endif 386 IF( ln_diatrc .AND. lk_iomput ) THEN 387 IF( ( wrk_not_released(3, 2) ) .OR. ( wrk_not_released(4, 1) ) ) & 388 & CALL ctl_stop('trc_bio : failed to release workspace arrays.') 389 ENDIF 506 390 ! 507 391 END SUBROUTINE trc_bio -
branches/2011/dev_r2787_LOCEAN3_TRA_TRP/NEMOGCM/NEMO/TOP_SRC/LOBSTER/trcexp.F90
r2715 r2819 53 53 !! COLUMN BELOW THE SURFACE LAYER. 54 54 !!--------------------------------------------------------------------- 55 !! 55 56 INTEGER, INTENT( in ) :: kt ! ocean time-step index 56 57 !! 57 INTEGER :: ji, jj, jk, jl, ikt 58 INTEGER :: ji, jj, jk, jl, ikt, ierr 58 59 REAL(wp) :: zgeolpoc, zfact, zwork, ze3t, zsedpocd 59 REAL(wp), DIMENSION(:,:,:), ALLOCATABLE :: 60 REAL(wp), DIMENSION(:,:,:), ALLOCATABLE :: ztrbio 60 61 CHARACTER (len=25) :: charout 61 62 !!--------------------------------------------------------------------- … … 67 68 ENDIF 68 69 70 IF( l_trdtrc ) THEN 71 ALLOCATE( ztrbio(jpi,jpj,jpk) , STAT = ierr ) ! temporary save of trends 72 IF( ierr > 0 ) THEN 73 CALL ctl_stop( 'trc_exp: unable to allocate ztrbio array' ) ; RETURN 74 ENDIF 75 ztrbio(:,:,:) = tra(:,:,:,jp_lob_no3) 76 ENDIF 77 69 78 ! VERTICAL DISTRIBUTION OF NEWLY PRODUCED BIOGENIC 70 79 ! POC IN THE WATER COLUMN … … 72 81 ! LAYERS IS DETERMINED BY DMIN3 DEFINED IN sms_lobster.F90 73 82 ! ---------------------------------------------------------------------- 74 75 IF( l_trdtrc )THEN76 ALLOCATE( ztrbio(jpi,jpj,jpk) )77 ztrbio(:,:,:) = tra(:,:,:,jp_lob_no3)78 ENDIF79 80 83 DO jk = 1, jpkm1 81 84 DO jj = 2, jpjm1 … … 114 117 115 118 ! Oa & Ek: diagnostics depending on jpdia2d ! left as example 116 #if defined key_diatrc 117 # if ! defined key_iomput 118 trc2d(:,:,jp_lob0_2d + 18) = sedpocn(:,:) 119 # else 120 CALL iom_put( "SEDPOC" , sedpocn ) 121 # endif 122 #endif 119 IF( ln_diatrc ) THEN 120 IF( lk_iomput ) THEN ; CALL iom_put( "SEDPOC" , sedpocn ) 121 ELSE ; trc2d(:,:,jp_lob0_2d + 18) = sedpocn(:,:) 122 ENDIF 123 ENDIF 123 124 124 125 … … 146 147 jl = jp_lob0_trd + 16 147 148 CALL trd_mod_trc( ztrbio, jl, kt ) ! handle the trend 149 DEALLOCATE( ztrbio ) 148 150 ENDIF 149 150 IF( l_trdtrc ) DEALLOCATE( ztrbio )151 151 152 152 IF(ln_ctl) THEN ! print mean trends (used for debugging) -
branches/2011/dev_r2787_LOCEAN3_TRA_TRP/NEMOGCM/NEMO/TOP_SRC/LOBSTER/trcnam_lobster.F90
r2715 r2819 12 12 !! trc_nam_lobster : LOBSTER model namelist read 13 13 !!---------------------------------------------------------------------- 14 USE oce_trc ! Ocean variables 15 USE par_trc ! TOP parameters 16 USE trc ! TOP variables 17 USE sms_lobster ! sms trends 14 USE oce_trc ! Ocean variables 15 USE par_trc ! TOP parameters 16 USE trc ! TOP variables 17 USE trdmod_trc_oce , ONLY : lk_trdmld_trc ! tracers trend flag 18 USE sms_lobster ! sms trends 19 USE iom ! I/O manager 18 20 19 21 IMPLICIT NONE … … 41 43 INTEGER :: numnatl 42 44 !! 43 #if defined key_diatrc && ! defined key_iomput44 45 INTEGER :: jl, jn 45 ! definition of additional diagnostic as a structure 46 TYPE DIAG 47 CHARACTER(len = 20) :: snamedia !: short name 48 CHARACTER(len = 80 ) :: lnamedia !: long name 49 CHARACTER(len = 20 ) :: unitdia !: unit 50 END TYPE DIAG 51 52 TYPE(DIAG) , DIMENSION(jp_lobster_2d) :: lobdia2d 53 TYPE(DIAG) , DIMENSION(jp_lobster_3d) :: lobdia3d 54 #endif 55 #if defined key_diabio || defined key_trdmld_trc 56 INTEGER :: js, jd 57 ! definition of additional diagnostic as a structure 58 TYPE DIABIO 59 CHARACTER(len = 20) :: snamebio !: short name 60 CHARACTER(len = 80 ) :: lnamebio !: long name 61 CHARACTER(len = 20 ) :: unitbio !: unit 62 END TYPE DIABIO 63 64 TYPE(DIABIO) , DIMENSION(jp_lobster_trd) :: lobdiabio 65 #endif 46 TYPE(DIAG), DIMENSION(jp_lobster_2d ) :: lobdia2d 47 TYPE(DIAG), DIMENSION(jp_lobster_3d ) :: lobdia3d 48 TYPE(DIAG), DIMENSION(jp_lobster_trd) :: lobdiabio 66 49 67 50 NAMELIST/namlobphy/ apmin, tmumax, rgamma, fphylab, tmmaxp, tmminp, & … … 77 60 78 61 NAMELIST/namlobopt/ xkg0, xkr0, xkgp, xkrp, xlg, xlr, rpig 79 #if defined key_diatrc && ! defined key_iomput 80 NAMELIST/namlobdia/nn_writedia, lobdia3d, lobdia2d ! additional diagnostics 81 #endif 82 #if defined key_diabio || defined key_trdmld_trc 83 NAMELIST/namlobdbi/nwritebio, lobdiabio 84 #endif 62 NAMELIST/namlobdia/ lobdia3d, lobdia2d ! additional diagnostics 63 NAMELIST/namlobdbi/ lobdiabio 85 64 !!---------------------------------------------------------------------- 86 65 … … 278 257 ENDIF 279 258 280 #if defined key_diatrc && ! defined key_iomput 281 282 ! Namelist namlobdia 283 ! ------------------- 284 nn_writedia = 10 ! default values 285 286 DO jl = 1, jp_lobster_2d 287 jn = jp_lob0_2d + jl - 1 288 WRITE(ctrc2d(jn),'("2D_",I1)') jn ! short name 289 WRITE(ctrc2l(jn),'("2D DIAGNOSTIC NUMBER ",I2)') jn ! long name 290 ctrc2u(jn) = ' ' ! units 291 END DO 292 ! ! 3D output arrays 293 DO jl = 1, jp_lobster_3d 294 jn = jp_lob0_3d + jl - 1 295 WRITE(ctrc3d(jn),'("3D_",I1)') jn ! short name 296 WRITE(ctrc3l(jn),'("3D DIAGNOSTIC NUMBER ",I2)') jn ! long name 297 ctrc3u(jn) = ' ' ! units 298 END DO 299 300 REWIND( numnatl ) ! read natrtd 301 READ ( numnatl, namlobdia ) 302 303 DO jl = 1, jp_lobster_2d 304 jn = jp_lob0_2d + jl - 1 305 ctrc2d(jn) = lobdia2d(jl)%snamedia 306 ctrc2l(jn) = lobdia2d(jl)%lnamedia 307 ctrc2u(jn) = lobdia2d(jl)%unitdia 308 END DO 309 310 DO jl = 1, jp_lobster_3d 311 jn = jp_lob0_3d + jl - 1 312 ctrc3d(jn) = lobdia3d(jl)%snamedia 313 ctrc3l(jn) = lobdia3d(jl)%lnamedia 314 ctrc3u(jn) = lobdia3d(jl)%unitdia 315 END DO 316 317 IF(lwp) THEN ! control print 318 WRITE(numout,*) 319 WRITE(numout,*) ' Namelist : natadd' 320 WRITE(numout,*) ' frequency of outputs for additional arrays nn_writedia = ', nn_writedia 259 ! 260 IF( .NOT.lk_iomput .AND. ln_diatrc ) THEN 261 ! 262 ! Namelist namlobdia 263 ! ------------------- 264 DO jl = 1, jp_lobster_2d 265 WRITE(lobdia2d(jl)%sname,'("2D_",I1)') jl ! short name 266 WRITE(lobdia2d(jl)%lname,'("2D DIAGNOSTIC NUMBER ",I2)') jl ! long name 267 lobdia2d(jl)%units = ' ' ! units 268 END DO 269 ! ! 3D output arrays 270 DO jl = 1, jp_lobster_3d 271 WRITE(lobdia3d(jl)%sname,'("3D_",I1)') jl ! short name 272 WRITE(lobdia3d(jl)%lname,'("3D DIAGNOSTIC NUMBER ",I2)') jl ! long name 273 lobdia3d(jl)%units = ' ' ! units 274 END DO 275 276 REWIND( numnatl ) ! read natrtd 277 READ ( numnatl, namlobdia ) 278 279 DO jl = 1, jp_lobster_2d 280 jn = jp_lob0_2d + jl - 1 281 ctrc2d(jn) = lobdia2d(jl)%sname 282 ctrc2l(jn) = lobdia2d(jl)%lname 283 ctrc2u(jn) = lobdia2d(jl)%units 284 END DO 285 321 286 DO jl = 1, jp_lobster_3d 322 287 jn = jp_lob0_3d + jl - 1 323 WRITE(numout,*) ' 3d output field No : ',jn 324 WRITE(numout,*) ' short name : ', TRIM(ctrc3d(jn)) 325 WRITE(numout,*) ' long name : ', TRIM(ctrc3l(jn)) 326 WRITE(numout,*) ' unit : ', TRIM(ctrc3u(jn)) 288 ctrc3d(jn) = lobdia3d(jl)%sname 289 ctrc3l(jn) = lobdia3d(jl)%lname 290 ctrc3u(jn) = lobdia3d(jl)%units 291 END DO 292 293 IF(lwp) THEN ! control print 294 WRITE(numout,*) 295 WRITE(numout,*) ' Namelist : natadd' 296 DO jl = 1, jp_lobster_3d 297 jn = jp_lob0_3d + jl - 1 298 WRITE(numout,*) ' 3d diag nb : ', jn, ' short name : ', ctrc3d(jn), & 299 & ' long name : ', ctrc3l(jn), ' unit : ', ctrc3u(jn) 300 END DO 327 301 WRITE(numout,*) ' ' 328 END DO 329 330 DO jl = 1, jp_lobster_2d 331 jn = jp_lob0_2d + jl - 1 332 WRITE(numout,*) ' 2d output field No : ',jn 333 WRITE(numout,*) ' short name : ', TRIM(ctrc2d(jn)) 334 WRITE(numout,*) ' long name : ', TRIM(ctrc2l(jn)) 335 WRITE(numout,*) ' unit : ', TRIM(ctrc2u(jn)) 302 303 DO jl = 1, jp_lobster_2d 304 jn = jp_lob0_2d + jl - 1 305 WRITE(numout,*) ' 2d diag nb : ', jn, ' short name : ', ctrc2d(jn), & 306 & ' long name : ', ctrc2l(jn), ' unit : ', ctrc2u(jn) 307 END DO 336 308 WRITE(numout,*) ' ' 337 END DO338 ENDIF339 #endif340 341 #if defined key_diabio || defined key_trdmld_trc342 ! namlobdbi : bio diagnostics343 nwritebio = 10 ! default values344 345 DO js = 1, jp_lobster_trd346 jd = jp_lob0_trd + js - 1347 IF( jd < 10 ) THEN ; WRITE (ctrbio(jd),'("BIO_",I1)') jd ! short name348 ELSEIF (jd < 100 ) THEN ; WRITE (ctrbio(jd),'("BIO_",I2)') jd349 ELSE ; WRITE (ctrbio(jd),'("BIO_",I3)') jd350 309 ENDIF 351 WRITE(ctrbil(jd),'("BIOLOGICAL TREND NUMBER ",I2)') jd ! long name 352 ctrbiu(jd) = 'mmoleN/m3/s ' ! units 353 END DO 354 355 REWIND( numnatl ) 356 READ ( numnatl, namlobdbi ) 310 ! 311 ENDIF 312 313 IF( ( .NOT.lk_iomput .AND. ln_diabio ) .OR. lk_trdmld_trc ) THEN 314 ! 315 ! Namelist namlobdbi 316 ! ------------------- 317 DO jl = 1, jp_lobster_trd 318 IF( jl < 10 ) THEN ; WRITE (lobdiabio(jl)%sname,'("BIO_",I1)') jl ! short name 319 ELSEIF (jl < 100 ) THEN ; WRITE (lobdiabio(jl)%sname,'("BIO_",I2)') jl 320 ELSE ; WRITE (lobdiabio(jl)%sname,'("BIO_",I3)') jl 321 ENDIF 322 WRITE(lobdiabio(jl)%lname,'("BIOLOGICAL TREND NUMBER ",I2)') jl ! long name 323 lobdiabio(jl)%units = 'mmoleN/m3/s ' ! units 324 END DO 325 326 REWIND( numnatl ) 327 READ ( numnatl, namlobdbi ) 357 328 358 DO js = 1, jp_lobster_trd 359 jd = jp_lob0_trd + js - 1 360 ctrbio(jd) = lobdiabio(js)%snamebio 361 ctrbil(jd) = lobdiabio(js)%lnamebio 362 ctrbiu(jd) = lobdiabio(js)%unitbio 363 END DO 364 365 IF(lwp) THEN ! control print 366 WRITE(numout,*) 367 WRITE(numout,*) ' Namelist : namlobdbi' 368 WRITE(numout,*) ' frequency of outputs for biological trends nwritebio = ', nwritebio 369 DO js = 1, jp_lobster_trd 370 jd = jp_lob0_trd + js - 1 371 WRITE(numout,*) ' biological trend No : ',jd 372 WRITE(numout,*) ' short name : ', TRIM(ctrbio(jd)) 373 WRITE(numout,*) ' long name : ', TRIM(ctrbil(jd)) 374 WRITE(numout,*) ' unit : ', TRIM(ctrbiu(jd)) 329 DO jl = 1, jp_lobster_trd 330 jn = jp_lob0_trd + jl - 1 331 ctrbio(jl) = lobdiabio(jl)%sname 332 ctrbil(jl) = lobdiabio(jl)%lname 333 ctrbiu(jl) = lobdiabio(jl)%units 334 END DO 335 336 IF(lwp) THEN ! control print 337 WRITE(numout,*) 338 WRITE(numout,*) ' Namelist : namlobdbi' 339 DO jl = 1, jp_lobster_trd 340 jn = jp_lob0_trd + jl - 1 341 WRITE(numout,*) ' biological trend No : ', jn, ' short name : ', ctrbio(jn), & 342 & ' long name : ', ctrbio(jn), ' unit : ', ctrbio(jn) 343 END DO 375 344 WRITE(numout,*) ' ' 376 END DO 345 END IF 346 ! 377 347 END IF 378 #endif379 348 ! 380 349 END SUBROUTINE trc_nam_lobster -
branches/2011/dev_r2787_LOCEAN3_TRA_TRP/NEMOGCM/NEMO/TOP_SRC/LOBSTER/trcsed.F90
r2715 r2819 57 57 !!--------------------------------------------------------------------- 58 58 USE wrk_nemo, ONLY: wrk_in_use, wrk_not_released 59 USE wrk_nemo, ONLY: zwork => wrk_3d_2 60 USE wrk_nemo, ONLY: zw2d => wrk_2d_1 ! only used (if defined 61 ! key_diatrc && defined key_iomput) 59 USE wrk_nemo, ONLY: zw2d => wrk_2d_1, zwork => wrk_3d_2 62 60 !! 63 61 INTEGER, INTENT( in ) :: kt ! ocean time-step index 64 62 !! 65 INTEGER :: ji, jj, jk, jl 66 REAL(wp) :: ztra 67 REAL(wp), DIMENSION(:,:,:), ALLOCATABLE :: 63 INTEGER :: ji, jj, jk, jl, ierr 64 REAL(wp) :: ztra, ze3t 65 REAL(wp), DIMENSION(:,:,:), ALLOCATABLE :: ztrbio 68 66 CHARACTER (len=25) :: charout 69 67 !!--------------------------------------------------------------------- 70 71 IF( ( wrk_in_use(3,2)) .OR. ( wrk_in_use(2,1)) ) THEN72 CALL ctl_stop('trc_sed : requested workspace arrays unavailable.')73 RETURN74 END IF75 68 76 69 IF( kt == nit000 ) THEN … … 80 73 ENDIF 81 74 75 IF( wrk_in_use(2, 1) .OR. wrk_in_use(3, 2) ) THEN 76 CALL ctl_stop('trc_sed : requested workspace arrays unavailable.') ; RETURN 77 END IF 78 79 IF( l_trdtrc ) THEN 80 ALLOCATE( ztrbio(jpi,jpj,jpk) , STAT = ierr ) ! temporary save of trends 81 IF( ierr > 0 ) THEN 82 CALL ctl_stop( 'trc_sed: unable to allocate ztrbio array' ) ; RETURN 83 ENDIF 84 ztrbio(:,:,:) = tra(:,:,:,jp_lob_det) 85 ENDIF 86 87 IF( ln_diatrc .AND. lk_iomput ) zw2d(:,:) = 0. 88 82 89 ! sedimentation of detritus : upstream scheme 83 90 ! -------------------------------------------- … … 86 93 zwork(:,:,1 ) = 0.e0 ! surface value set to zero 87 94 zwork(:,:,jpk) = 0.e0 ! bottom value set to zero 88 89 #if defined key_diatrc && defined key_iomput90 zw2d(:,:) = 0.91 # endif92 93 IF( l_trdtrc )THEN94 ALLOCATE( ztrbio(jpi,jpj,jpk) )95 ztrbio(:,:,:) = tra(:,:,:,jp_lob_det)96 ENDIF97 95 98 96 ! tracer flux at w-point: we use -vsed (downward flux) with simplification : no e1*e2 … … 104 102 DO jk = 1, jpkm1 105 103 DO jj = 1, jpj 106 DO ji = 1, jpi104 DO ji = 1, jpi 107 105 ztra = - ( zwork(ji,jj,jk) - zwork(ji,jj,jk+1) ) / fse3t(ji,jj,jk) 108 106 tra(ji,jj,jk,jp_lob_det) = tra(ji,jj,jk,jp_lob_det) + ztra 109 #if defined key_diabio 110 trbio(ji,jj,jk,jp_lob0_trd + 7) = ztra 111 #endif 112 #if defined key_diatrc 113 # if ! defined key_iomput 114 trc2d(ji,jj,jp_lob0_2d + 7) = trc2d(ji,jj,jp_lob0_2d + 7) + ztra * fse3t(ji,jj,jk) * 86400. 115 # else 116 zw2d(ji,jj) = zw2d(ji,jj) + ztra * fse3t(ji,jj,jk) * 86400. 117 # endif 118 #endif 107 ! 108 IF( ln_diabio ) trbio(ji,jj,jk,jp_lob0_trd + 7) = ztra 109 IF( ln_diatrc ) THEN 110 ze3t = ztra * fse3t(ji,jj,jk) * 86400. 111 IF( lk_iomput ) THEN ; zw2d(ji,jj) = zw2d(ji,jj) + ze3t 112 ELSE ; trc2d(ji,jj,jp_lob0_2d + 7) = trc2d(ji,jj,jp_lob0_2d + 7) + ze3t 113 ENDIF 114 ENDIF 115 ! 119 116 END DO 120 117 END DO 121 118 END DO 122 119 123 #if defined key_diabio 124 jl = jp_lob0_trd + 7 125 CALL lbc_lnk (trbio(:,:,1,jl), 'T', 1. ) ! Lateral boundary conditions on trcbio 126 #endif 127 #if defined key_diatrc 128 # if ! defined key_iomput 129 jl = jp_lob0_2d + 7 130 CALL lbc_lnk( trc2d(:,:,jl), 'T', 1. ) ! Lateral boundary conditions on trc2d 131 # else 132 CALL lbc_lnk( zw2d(:,:), 'T', 1. ) ! Lateral boundary conditions on zw2d 133 CALL iom_put( "TDETSED", zw2d ) 134 # endif 135 #endif 136 ! 120 IF( ln_diatrc .AND. lk_iomput ) CALL iom_put( "TDETSED", zw2d ) 137 121 138 122 IF( l_trdtrc ) THEN … … 140 124 jl = jp_lob0_trd + 7 141 125 CALL trd_mod_trc( ztrbio, jl, kt ) ! handle the trend 126 DEALLOCATE( ztrbio ) 142 127 ENDIF 143 144 IF( l_trdtrc ) DEALLOCATE( ztrbio )145 128 146 129 IF(ln_ctl) THEN ! print mean trends (used for debugging) … … 150 133 ENDIF 151 134 152 IF( ( wrk_not_released( 3, 2) ) .OR. ( wrk_not_released(2, 1) ) ) &135 IF( ( wrk_not_released(2, 1) ) .OR. ( wrk_not_released(3, 2) ) ) & 153 136 & CALL ctl_stop('trc_sed : failed to release workspace arrays.') 154 137 -
branches/2011/dev_r2787_LOCEAN3_TRA_TRP/NEMOGCM/NEMO/TOP_SRC/LOBSTER/trcsms_lobster.F90
r2715 r2819 45 45 !! ** Method : - ??? 46 46 !! -------------------------------------------------------------------- 47 USE wrk_nemo, ONLY: wrk_in_use, wrk_not_released48 USE wrk_nemo, ONLY: ztrlob => wrk_3d_1 ! used for lobster sms trends49 47 !! 50 48 INTEGER, INTENT( in ) :: kt ! ocean time-step index 49 ! 51 50 INTEGER :: jn 52 51 !! -------------------------------------------------------------------- 53 54 IF( wrk_in_use(3, 1) ) THEN55 CALL ctl_stop('trc_sms_lobster : requested workspace array unavailable') ; RETURN56 ENDIF57 52 58 53 CALL trc_opt( kt ) ! optical model … … 62 57 63 58 IF( l_trdtrc ) THEN 64 DO jn = jp_lob0, jp_lob1 65 ztrlob(:,:,:) = tra(:,:,:,jn) 66 CALL trd_mod_trc( ztrlob, jn, jptra_trd_sms, kt ) ! save trends 67 END DO 59 DO jn = jp_lob0, jp_lob1 60 CALL trd_mod_trc( tra(:,:,:,jn), jn, jptra_trd_sms, kt ) ! save trends 61 END DO 68 62 END IF 69 63 70 64 IF( lk_trdmld_trc ) CALL trd_mld_bio( kt ) ! trends: Mixed-layer 71 72 IF( wrk_not_released(3, 1) ) CALL ctl_stop('trc_sms_lobster : failed to release workspace array.')73 65 ! 74 66 END SUBROUTINE trc_sms_lobster -
branches/2011/dev_r2787_LOCEAN3_TRA_TRP/NEMOGCM/NEMO/TOP_SRC/PISCES/p4zbio.F90
r2715 r2819 14 14 !! compartments of PISCES 15 15 !!---------------------------------------------------------------------- 16 USE oce_trc ! 17 USE trc !18 USE sms_pisces ! 19 USE p4zsink ! 20 USE p4zopt ! 21 USE p4zlim ! 22 USE p4zprod ! 23 USE p4zmort ! 24 USE p4zmicro ! 25 USE p4zmeso ! 26 USE p4zrem ! 27 USE prtctl_trc 28 USE iom 16 USE oce_trc ! shared variables between ocean and passive tracers 17 USE trc ! passive tracers common variables 18 USE sms_pisces ! PISCES Source Minus Sink variables 19 USE p4zsink ! vertical flux of particulate matter due to sinking 20 USE p4zopt ! optical model 21 USE p4zlim ! Co-limitations of differents nutrients 22 USE p4zprod ! Growth rate of the 2 phyto groups 23 USE p4zmort ! Mortality terms for phytoplankton 24 USE p4zmicro ! Sources and sinks of microzooplankton 25 USE p4zmeso ! Sources and sinks of mesozooplankton 26 USE p4zrem ! Remineralisation of organic matter 27 USE prtctl_trc ! print control for debugging 28 USE iom ! I/O manager 29 29 30 30 IMPLICIT NONE -
branches/2011/dev_r2787_LOCEAN3_TRA_TRP/NEMOGCM/NEMO/TOP_SRC/PISCES/p4zche.F90
r2715 r2819 17 17 !! p4z_che : Sea water chemistry computed following OCMIP protocol 18 18 !!---------------------------------------------------------------------- 19 USE oce_trc ! 20 USE trc ! 21 USE sms_pisces ! 22 USE lib_mpp ! MPP library19 USE oce_trc ! shared variables between ocean and passive tracers 20 USE trc ! passive tracers common variables 21 USE sms_pisces ! PISCES Source Minus Sink variables 22 USE lib_mpp ! MPP library 23 23 24 24 IMPLICIT NONE -
branches/2011/dev_r2787_LOCEAN3_TRA_TRP/NEMOGCM/NEMO/TOP_SRC/PISCES/p4zflx.F90
r2715 r2819 17 17 !! p4z_flx_init : Read the namelist 18 18 !!---------------------------------------------------------------------- 19 USE trc 20 USE oce_trc ! 21 USE trc 22 USE sms_pisces 23 USE prtctl_trc 24 USE p4zche 25 USE iom 19 USE oce_trc ! shared variables between ocean and passive tracers 20 USE trc ! passive tracers common variables 21 USE sms_pisces ! PISCES Source Minus Sink variables 22 USE p4zche ! Chemical model 23 USE prtctl_trc ! print control for debugging 24 USE iom ! I/O manager 26 25 #if defined key_cpl_carbon_cycle 27 USE sbc_oce , ONLY : atm_co226 USE sbc_oce, ONLY : atm_co2 ! atmospheric pCO2 28 27 #endif 29 28 … … 137 136 ! Compute the piston velocity for O2 and CO2 138 137 zkgwan = 0.3 * zws + 2.5 * ( 0.5246 + 0.016256 * ztc + 0.00049946 * ztc2 ) 138 zkgwan = zkgwan * xconv * ( 1.- fr_i(ji,jj) ) * tmask(ji,jj,1) 139 139 # if defined key_degrad 140 zkgwan = zkgwan * xconv * ( 1.- fr_i(ji,jj) ) * tmask(ji,jj,1) * facvol(ji,jj,1) 141 #else 142 zkgwan = zkgwan * xconv * ( 1.- fr_i(ji,jj) ) * tmask(ji,jj,1) 140 zkgwan = zkgwan * facvol(ji,jj,1) 143 141 #endif 144 142 ! compute gas exchange for CO2 and O2 … … 161 159 zflu16 = trn(ji,jj,1,jpoxy) * tmask(ji,jj,1) * zkgo2(ji,jj) 162 160 tra(ji,jj,1,jpoxy) = tra(ji,jj,1,jpoxy) + ( zfld16 - zflu16 ) / fse3t(ji,jj,1) 163 164 #if defined key_diatrc 165 ! Save diagnostics 166 # if ! defined key_iomput 161 #if defined key_iomput 162 zoflx(ji,jj) = ( zfld16 - zflu16 ) * 1000. * tmask(ji,jj,1) 163 zkg (ji,jj) = zkgco2(ji,jj) * tmask(ji,jj,1) 164 zdpco2(ji,jj) = ( satmco2(ji,jj) - zh2co3(ji,jj) / ( chemc(ji,jj,1) + rtrn ) ) * tmask(ji,jj,1) 165 zdpo2 (ji,jj) = ( atcox - trn(ji,jj,1,jpoxy) / ( chemc(ji,jj,2) + rtrn ) ) * tmask(ji,jj,1) 166 # else 167 167 zfact = 1. / e1e2t(ji,jj) / rfact 168 168 trc2d(ji,jj,jp_pcs0_2d ) = oce_co2(ji,jj) * zfact 169 169 trc2d(ji,jj,jp_pcs0_2d + 1) = ( zfld16 - zflu16 ) * 1000. * tmask(ji,jj,1) 170 170 trc2d(ji,jj,jp_pcs0_2d + 2) = zkgco2(ji,jj) * tmask(ji,jj,1) 171 trc2d(ji,jj,jp_pcs0_2d + 3) = ( satmco2(ji,jj) - zh2co3(ji,jj) / ( chemc(ji,jj,1) + rtrn ) ) & 172 & * tmask(ji,jj,1) 173 # else 174 zoflx(ji,jj) = ( zfld16 - zflu16 ) * 1000. * tmask(ji,jj,1) 175 zkg (ji,jj) = zkgco2(ji,jj) * tmask(ji,jj,1) 176 zdpco2(ji,jj) = ( satmco2(ji,jj) - zh2co3(ji,jj) / ( chemc(ji,jj,1) + rtrn ) ) * tmask(ji,jj,1) 177 zdpo2 (ji,jj) = ( atcox - trn(ji,jj,1,jpoxy) / ( chemc(ji,jj,2) + rtrn ) ) * tmask(ji,jj,1) 178 # endif 179 #endif 171 trc2d(ji,jj,jp_pcs0_2d + 3) = ( satmco2(ji,jj) - zh2co3(ji,jj) / ( chemc(ji,jj,1) + rtrn ) ) * tmask(ji,jj,1) 172 # endif 180 173 END DO 181 174 END DO 182 175 183 t_oce_co2_flx = t_oce_co2_flx + glob_sum( oce_co2(:,:) ) 176 t_oce_co2_flx = t_oce_co2_flx + glob_sum( oce_co2(:,:) ) ! Cumulative Total Flux of Carbon 184 177 IF( kt == nitend ) THEN 185 178 t_atm_co2_flx = glob_sum( satmco2(:,:) * e1e2t(:,:) ) ! Total atmospheric pCO2 186 179 ! 187 t_oce_co2_flx = (-1.) * t_oce_co2_flx * 12. / 1.e15 188 t_atm_co2_flx = t_atm_co2_flx / area 180 t_oce_co2_flx = (-1.) * t_oce_co2_flx * 12. / 1.e15 ! Conversion in PgC ; negative for out of the ocean 181 t_atm_co2_flx = t_atm_co2_flx / area ! global mean of atmospheric pCO2 189 182 ! 190 183 IF( lwp) THEN … … 205 198 ENDIF 206 199 207 # if defined key_diatrc && defined key_iomput 208 CALL iom_put( "Cflx" , oce_co2(:,:) / e1e2t(:,:) / rfact )209 CALL iom_put( "Oflx" , zoflx )210 CALL iom_put( "Kg" , zkg )211 CALL iom_put( "Dpco2", zdpco2 )212 CALL iom_put( "Dpo2" , zdpo2 )213 #endif 200 IF( ln_diatrc ) THEN 201 CALL iom_put( "Cflx" , oce_co2(:,:) / e1e2t(:,:) / rfact ) 202 CALL iom_put( "Oflx" , zoflx ) 203 CALL iom_put( "Kg" , zkg ) 204 CALL iom_put( "Dpco2", zdpco2 ) 205 CALL iom_put( "Dpo2" , zdpo2 ) 206 ENDIF 214 207 ! 215 208 IF( wrk_not_released(2, 1,2,3,4,5,6,7) ) CALL ctl_stop('p4z_flx: failed to release workspace arrays') … … 231 224 !!---------------------------------------------------------------------- 232 225 ! 233 REWIND( numnat ) ! read numnat234 READ ( numnat , nampisext )226 REWIND( numnatp ) ! read numnatp 227 READ ( numnatp, nampisext ) 235 228 ! 236 229 IF(lwp) THEN ! control print -
branches/2011/dev_r2787_LOCEAN3_TRA_TRP/NEMOGCM/NEMO/TOP_SRC/PISCES/p4zint.F90
r2715 r2819 13 13 !! p4z_int : interpolation and computation of various accessory fields 14 14 !!---------------------------------------------------------------------- 15 USE oce_trc ! 16 USE trc 17 USE sms_pisces 15 USE oce_trc ! shared variables between ocean and passive tracers 16 USE trc ! passive tracers common variables 17 USE sms_pisces ! PISCES Source Minus Sink variables 18 18 19 19 IMPLICIT NONE … … 21 21 22 22 PUBLIC p4z_int 23 PUBLIC p4z_int_alloc24 25 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: tgfunc !: Temp. dependancy of various biological rates26 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: tgfunc2 !: Temp. dependancy of mesozooplankton rates27 28 23 REAL(wp) :: xksilim = 16.5e-6_wp ! Half-saturation constant for the Si half-saturation constant computation 29 24 … … 41 36 !! ** Purpose : interpolation and computation of various accessory fields 42 37 !! 43 !! ** Method : - ???44 38 !!--------------------------------------------------------------------- 45 INTEGER :: ji, jj 46 REAL(wp) :: z dum39 INTEGER :: ji, jj ! dummy loop indices 40 REAL(wp) :: zvar ! local variable 47 41 !!--------------------------------------------------------------------- 48 42 … … 57 51 DO ji = 1, jpi 58 52 DO jj = 1, jpj 59 z dum= trn(ji,jj,1,jpsil) * trn(ji,jj,1,jpsil)60 xksimax(ji,jj) = MAX( xksimax(ji,jj), ( 1.+ 7.* z dum / ( xksilim * xksilim + zdum) ) * 1e-6 )53 zvar = trn(ji,jj,1,jpsil) * trn(ji,jj,1,jpsil) 54 xksimax(ji,jj) = MAX( xksimax(ji,jj), ( 1.+ 7.* zvar / ( xksilim * xksilim + zvar ) ) * 1e-6 ) 61 55 END DO 62 56 END DO … … 68 62 ! 69 63 END SUBROUTINE p4z_int 70 71 72 INTEGER FUNCTION p4z_int_alloc()73 !!----------------------------------------------------------------------74 !! *** ROUTINE p4z_int_alloc ***75 !!----------------------------------------------------------------------76 ALLOCATE( tgfunc(jpi,jpj,jpk), tgfunc2(jpi,jpj,jpk), STAT=p4z_int_alloc )77 !78 IF( p4z_int_alloc /= 0 ) CALL ctl_warn('p4z_int_alloc : failed to allocate arrays.')79 !80 END FUNCTION p4z_int_alloc81 64 82 65 #else -
branches/2011/dev_r2787_LOCEAN3_TRA_TRP/NEMOGCM/NEMO/TOP_SRC/PISCES/p4zlim.F90
r2528 r2819 14 14 !! p4z_lim_init : Read the namelist 15 15 !!---------------------------------------------------------------------- 16 USE trc 17 USE oce_trc ! 18 USE trc ! 19 USE sms_pisces ! 16 USE oce_trc ! shared variables between ocean and passive tracers 17 USE trc ! passive tracers common variables 18 USE sms_pisces ! PISCES Source Minus Sink variables 20 19 21 20 IMPLICIT NONE … … 184 183 & concnnh4, concdnh4, xksi1, xksi2, xkdoc, caco3r 185 184 186 REWIND( numnat ) ! read numnat187 READ ( numnat , nampislim )185 REWIND( numnatp ) ! read numnat 186 READ ( numnatp, nampislim ) 188 187 189 188 IF(lwp) THEN ! control print -
branches/2011/dev_r2787_LOCEAN3_TRA_TRP/NEMOGCM/NEMO/TOP_SRC/PISCES/p4zlys.F90
r2715 r2819 17 17 !! p4z_lys_init : Read the namelist parameters 18 18 !!---------------------------------------------------------------------- 19 USE trc 20 USE oce_trc ! 21 USE trc 22 USE sms_pisces 23 USE prtctl_trc 24 USE iom 19 USE oce_trc ! shared variables between ocean and passive tracers 20 USE trc ! passive tracers common variables 21 USE sms_pisces ! PISCES Source Minus Sink variables 22 USE prtctl_trc ! print control for debugging 23 USE iom ! I/O manager 25 24 26 25 IMPLICIT NONE … … 62 61 INTEGER, INTENT(in) :: kt ! ocean time step 63 62 INTEGER :: ji, jj, jk, jn 64 REAL(wp) :: zbot, zalk, zdic, zph, z remco3, zah263 REAL(wp) :: zbot, zalk, zdic, zph, zah2 65 64 REAL(wp) :: zdispot, zfact, zalka 66 65 REAL(wp) :: zomegaca, zexcess, zexcess0 67 #if defined key_diatrc && defined key_iomput68 66 REAL(wp) :: zrfact2 69 #endif70 67 CHARACTER (len=25) :: charout 71 68 !!--------------------------------------------------------------------- … … 75 72 END IF 76 73 77 zco3(:,:,:) = 0. 78 # if defined key_diatrc && defined key_iomput 74 zco3 (:,:,:) = 0. 79 75 zcaldiss(:,:,:) = 0. 80 # endif81 76 ! ------------------------------------------- 82 77 ! COMPUTE [CO3--] and [H+] CONCENTRATIONS … … 91 86 !CDIR NOVERRCHK 92 87 DO ji = 1, jpi 93 94 88 ! SET DUMMY VARIABLE FOR TOTAL BORATE 95 zbot = borat(ji,jj,jk) 96 97 ! SET DUMMY VARIABLE FOR TOTAL BORATE 98 zbot = borat(ji,jj,jk) 89 zbot = borat(ji,jj,jk) 99 90 zfact = rhop (ji,jj,jk) / 1000. + rtrn 100 101 91 ! SET DUMMY VARIABLE FOR [H+] 102 92 zph = hi(ji,jj,jk) * tmask(ji,jj,jk) / zfact + ( 1.-tmask(ji,jj,jk) ) * 1.e-9 103 104 93 ! SET DUMMY VARIABLE FOR [SUM(CO2)]GIVEN 105 94 zdic = trn(ji,jj,jk,jpdic) / zfact 106 95 zalka = trn(ji,jj,jk,jptal) / zfact 107 108 96 ! CALCULATE [ALK]([CO3--], [HCO3-]) 109 97 zalk = zalka - ( akw3(ji,jj,jk) / zph - zph & 110 98 & + zbot / (1.+ zph / akb3(ji,jj,jk) ) ) 111 112 99 ! CALCULATE [H+] and [CO3--] 113 100 zah2 = SQRT( (zdic-zalk)*(zdic-zalk)+ & … … 146 133 ! (ACCORDING TO THIS FORMULATION ALSO SOME PARTICULATE 147 134 ! CACO3 GETS DISSOLVED EVEN IN THE CASE OF OVERSATURATION) 135 zdispot = kdca * zexcess * trn(ji,jj,jk,jpcal) 148 136 # if defined key_degrad 149 zdispot = kdca * zexcess * trn(ji,jj,jk,jpcal) * facvol(ji,jj,jk) 150 # else 151 zdispot = kdca * zexcess * trn(ji,jj,jk,jpcal) 137 zdispot = zdispot * facvol(ji,jj,jk) 152 138 # endif 153 154 139 ! CHANGE OF [CO3--] , [ALK], PARTICULATE [CACO3], 155 140 ! AND [SUM(CO2)] DUE TO CACO3 DISSOLUTION/PRECIPITATION 156 zremco3 = zdispot / rmtss 157 zco3(ji,jj,jk) = zco3(ji,jj,jk) + zremco3 * rfact 158 tra(ji,jj,jk,jptal) = tra(ji,jj,jk,jptal) + 2. * zremco3 159 tra(ji,jj,jk,jpcal) = tra(ji,jj,jk,jpcal) - zremco3 160 tra(ji,jj,jk,jpdic) = tra(ji,jj,jk,jpdic) + zremco3 161 162 # if defined key_diatrc && defined key_iomput 163 zcaldiss(ji,jj,jk) = zremco3 ! calcite dissolution 164 # endif 141 zcaldiss(ji,jj,jk) = zdispot / rmtss ! calcite dissolution 142 zco3(ji,jj,jk) = zco3(ji,jj,jk) + zcaldiss(ji,jj,jk) * rfact 143 ! 144 tra(ji,jj,jk,jptal) = tra(ji,jj,jk,jptal) + 2. * zcaldiss(ji,jj,jk) 145 tra(ji,jj,jk,jpcal) = tra(ji,jj,jk,jpcal) - zcaldiss(ji,jj,jk) 146 tra(ji,jj,jk,jpdic) = tra(ji,jj,jk,jpdic) + zcaldiss(ji,jj,jk) 165 147 END DO 166 148 END DO 167 149 END DO 168 150 169 # if defined key_diatrc 170 # if ! defined key_iomput 171 trc3d(:,:,:,jp_pcs0_3d ) = hi (:,:,:) * tmask(:,:,:) 172 trc3d(:,:,:,jp_pcs0_3d + 1) = zco3(:,:,:) * tmask(:,:,:) 173 trc3d(:,:,:,jp_pcs0_3d + 2) = aksp(:,:,:) / calcon * tmask(:,:,:) 174 # else 175 zrfact2 = 1.e3 * rfact2r 176 CALL iom_put( "PH" , hi (:,:,:) * tmask(:,:,:) ) 177 CALL iom_put( "CO3" , zco3 (:,:,:) * tmask(:,:,:) ) 178 CALL iom_put( "CO3sat", aksp (:,:,:) / calcon * tmask(:,:,:) ) 179 CALL iom_put( "DCAL" , zcaldiss(:,:,:) * zrfact2 * tmask(:,:,:) ) 180 # endif 151 IF( ln_diatrc ) THEN 152 zrfact2 = 1.e3 * rfact2r 153 CALL iom_put( "PH" , hi (:,:,:) * tmask(:,:,:) ) 154 CALL iom_put( "CO3" , zco3 (:,:,:) * tmask(:,:,:) ) 155 CALL iom_put( "CO3sat", aksp (:,:,:) / calcon * tmask(:,:,:) ) 156 CALL iom_put( "DCAL" , zcaldiss(:,:,:) * zrfact2 * tmask(:,:,:) ) 157 # if ! defined key_iomput 158 trc3d(:,:,:,jp_pcs0_3d ) = hi (:,:,:) * tmask(:,:,:) 159 trc3d(:,:,:,jp_pcs0_3d + 1) = zco3(:,:,:) * tmask(:,:,:) 160 trc3d(:,:,:,jp_pcs0_3d + 2) = aksp(:,:,:) / calcon * tmask(:,:,:) 181 161 # endif 162 ENDIF 182 163 ! 183 164 IF(ln_ctl) THEN ! print mean trends (used for debugging) … … 207 188 NAMELIST/nampiscal/ kdca, nca 208 189 209 REWIND( numnat ) ! read numnat210 READ ( numnat , nampiscal )190 REWIND( numnatp ) ! read numnatp 191 READ ( numnatp, nampiscal ) 211 192 212 193 IF(lwp) THEN ! control print -
branches/2011/dev_r2787_LOCEAN3_TRA_TRP/NEMOGCM/NEMO/TOP_SRC/PISCES/p4zmeso.F90
r2528 r2819 14 14 !! p4z_meso_init : Initialization of the parameters for mesozooplankton 15 15 !!---------------------------------------------------------------------- 16 USE trc 17 USE oce_trc ! 18 USE trc ! 19 USE sms_pisces ! 20 USE prtctl_trc 21 USE p4zint 22 USE p4zsink 23 USE iom 16 USE oce_trc ! shared variables between ocean and passive tracers 17 USE trc ! passive tracers common variables 18 USE sms_pisces ! PISCES Source Minus Sink variables 19 USE p4zsink ! vertical flux of particulate matter due to sinking 20 USE prtctl_trc ! print control for debugging 21 USE iom ! I/O manager 22 24 23 25 24 IMPLICIT NONE … … 75 74 REAL(wp) :: zgrazfff,zgrazffe 76 75 CHARACTER (len=25) :: charout 77 #if defined key_diatrc && defined key_iomput78 76 REAL(wp) :: zrfact2 79 #endif80 77 81 78 !!--------------------------------------------------------------------- … … 84 81 DO jj = 1, jpj 85 82 DO ji = 1, jpi 86 87 83 zcompam = MAX( ( trn(ji,jj,jk,jpmes) - 1.e-9 ), 0.e0 ) 84 zstep = xstep 88 85 # if defined key_degrad 89 zstep = xstep * facvol(ji,jj,jk) 90 # else 91 zstep = xstep 92 # endif 93 zfact = zstep * tgfunc(ji,jj,jk) * zcompam 86 zstep = zstep * facvol(ji,jj,jk) 87 # endif 88 zfact = zstep * tgfunc(ji,jj,jk) * zcompam 94 89 95 90 ! Respiration rates of both zooplankton … … 132 127 zgrazffe = grazflux * zstep * wsbio4(ji,jj,jk) & 133 128 & * tgfunc2(ji,jj,jk) * trn(ji,jj,jk,jpgoc) * trn(ji,jj,jk,jpmes) 129 # if defined key_degrad 130 zgrazffe = zgrazffe * facvol(ji,jj,jk) 131 # endif 134 132 zgrazfff = zgrazffe * trn(ji,jj,jk,jpbfe) / (trn(ji,jj,jk,jpgoc) + rtrn) 135 133 # else … … 143 141 !!--------------------------- KRIEST3 ------------------------------------------- 144 142 145 zgrazffe = grazflux * zstep * wsbio3(ji,jj,jk) &143 zgrazffe = grazflux * zstep * wsbio3(ji,jj,jk) & 146 144 & * tgfunc2(ji,jj,jk) * trn(ji,jj,jk,jppoc) * trn(ji,jj,jk,jpmes) 147 zgrazfff = zgrazffe * trn(ji,jj,jk,jpsfe) / (trn(ji,jj,jk,jppoc) + rtrn) 145 # if defined key_degrad 146 zgrazffe = zgrazffe * facvol(ji,jj,jk) 147 # endif 148 zgrazfff = zgrazffe * trn(ji,jj,jk,jpsfe) / (trn(ji,jj,jk,jppoc) + rtrn) 148 149 # endif 149 150 150 #if defined key_diatrc 151 ! Total grazing ( grazing by microzoo is already computed in p4zmicro ) 151 ! Total grazing ( grazing by microzoo is already computed in p4zmicro ) 152 152 grazing(ji,jj,jk) = grazing(ji,jj,jk) + ( zgrazd + zgrazz + zgrazn + zgrazpoc + zgrazffe ) 153 #endif154 153 155 154 ! Mesozooplankton efficiency … … 200 199 201 200 zprcaca = xfracal(ji,jj,jk) * unass2 * zgrazn 202 #if defined key_diatrc 201 ! calcite production 203 202 prodcal(ji,jj,jk) = prodcal(ji,jj,jk) + zprcaca ! prodcal=prodcal(nanophy)+prodcal(microzoo)+prodcal(mesozoo) 204 #endif 203 ! 205 204 zprcaca = part * zprcaca 206 205 tra(ji,jj,jk,jpdic) = tra(ji,jj,jk,jpdic) - zprcaca … … 226 225 END DO 227 226 ! 228 #if defined key_diatrc && defined key_iomput 229 zrfact2 = 1.e3 * rfact2r 230 ! Total grazing of phyto by zoo 231 grazing(:,:,:) = grazing(:,:,:) * zrfact2 * tmask(:,:,:) 232 ! Calcite production 233 prodcal(:,:,:) = prodcal(:,:,:) * zrfact2 * tmask(:,:,:) 234 IF( jnt == nrdttrc ) then 235 CALL iom_put( "GRAZ" , grazing ) ! Total grazing of phyto by zooplankton 236 CALL iom_put( "PCAL" , prodcal ) ! Calcite production 227 IF( ln_diatrc ) THEN 228 zrfact2 = 1.e3 * rfact2r 229 grazing(:,:,:) = grazing(:,:,:) * zrfact2 * tmask(:,:,:) ! Total grazing of phyto by zoo 230 prodcal(:,:,:) = prodcal(:,:,:) * zrfact2 * tmask(:,:,:) ! Calcite production 231 IF( jnt == nrdttrc ) THEN 232 CALL iom_put( "GRAZ" , grazing ) ! Total grazing of phyto by zooplankton 233 CALL iom_put( "PCAL" , prodcal ) ! Calcite production 234 ENDIF 237 235 ENDIF 238 #endif239 236 240 237 IF(ln_ctl) THEN ! print mean trends (used for debugging) … … 263 260 & xprefz, xprefpoc, xkgraz2, epsher2, sigma2, unass2, grazflux 264 261 265 REWIND( numnat ) ! read numnat266 READ ( numnat , nampismes )262 REWIND( numnatp ) ! read numnatp 263 READ ( numnatp, nampismes ) 267 264 268 265 -
branches/2011/dev_r2787_LOCEAN3_TRA_TRP/NEMOGCM/NEMO/TOP_SRC/PISCES/p4zmicro.F90
r2528 r2819 14 14 !! p4z_micro_init : Initialize and read the appropriate namelist 15 15 !!---------------------------------------------------------------------- 16 USE trc 17 USE oce_trc ! 18 USE trc ! 19 USE sms_pisces ! 20 USE prtctl_trc 21 USE p4zint 22 USE p4zsink 23 USE iom 16 USE oce_trc ! shared variables between ocean and passive tracers 17 USE trc ! passive tracers common variables 18 USE sms_pisces ! PISCES Source Minus Sink variables 19 USE p4zsink ! vertical flux of particulate matter due to sinking 20 USE prtctl_trc ! print control for debugging 24 21 25 22 IMPLICIT NONE … … 28 25 PUBLIC p4z_micro ! called in p4zbio.F90 29 26 PUBLIC p4z_micro_init ! called in trcsms_pisces.F90 27 PUBLIC p4z_micro_alloc ! called in trcsms_pisces.F90 30 28 31 29 !! * Shared module variables … … 74 72 !!--------------------------------------------------------------------- 75 73 76 77 #if defined key_diatrc 78 grazing(:,:,:) = 0. !: Initialisation of grazing 79 #endif 80 74 grazing(:,:,:) = 0. !: grazing set to zero 81 75 zstep = rfact2 / rday ! Time step duration for biology 82 76 … … 85 79 DO ji = 1, jpi 86 80 zcompaz = MAX( ( trn(ji,jj,jk,jpzoo) - 1.e-9 ), 0.e0 ) 81 zstep = xstep 87 82 # if defined key_degrad 88 zstep = xstep * facvol(ji,jj,jk) 89 # else 90 zstep = xstep 83 zstep = zstep * facvol(ji,jj,jk) 91 84 # endif 92 85 zfact = zstep * tgfunc(ji,jj,jk) * zcompaz … … 126 119 zgrazmf = zgrazm * trn(ji,jj,jk,jpsfe) / (trn(ji,jj,jk,jppoc) + rtrn) 127 120 zgrazsf = zgrazsd * trn(ji,jj,jk,jpdfe) / (trn(ji,jj,jk,jpdia) + rtrn) 128 #if defined key_diatrc 121 129 122 ! Grazing by microzooplankton 130 grazing(ji,jj,jk) = grazing(ji,jj,jk) + zgrazp + zgrazm + zgrazsd 131 #endif 123 grazing(ji,jj,jk) = grazing(ji,jj,jk) + zgrazp + zgrazm + zgrazsd 132 124 133 125 ! Various remineralization and excretion terms … … 172 164 tra(ji,jj,jk,jpsfe) = tra(ji,jj,jk,jpsfe) + ferat3 * zmortz + unass * ( zgrazpf + zgrazsf ) - (1.-unass) * zgrazmf 173 165 zprcaca = xfracal(ji,jj,jk) * unass * zgrazp 174 #if defined key_diatrc 166 ! 175 167 prodcal(ji,jj,jk) = prodcal(ji,jj,jk) + zprcaca ! prodcal=prodcal(nanophy)+prodcal(microzoo)+prodcal(mesozoo) 176 #endif 168 ! 177 169 zprcaca = part * zprcaca 178 170 tra(ji,jj,jk,jpdic) = tra(ji,jj,jk,jpdic) - zprcaca … … 212 204 & xpref2d, xkgraz, epsher, sigma1, unass 213 205 214 REWIND( numnat ) ! read numnat215 READ ( numnat , nampiszoo )206 REWIND( numnatp ) ! read numnatp 207 READ ( numnatp, nampiszoo ) 216 208 217 209 IF(lwp) THEN ! control print … … 233 225 END SUBROUTINE p4z_micro_init 234 226 227 INTEGER FUNCTION p4z_micro_alloc() 228 !!---------------------------------------------------------------------- 229 !! *** ROUTINE p4z_micro_alloc *** 230 !!---------------------------------------------------------------------- 231 ALLOCATE( grazing(jpi,jpj,jpk), STAT=p4z_micro_alloc ) 232 IF( p4z_micro_alloc /= 0 ) CALL ctl_warn('p4z_micro_alloc : failed to allocate arrays.') 233 234 END FUNCTION p4z_micro_alloc 235 235 236 #else 236 237 !!====================================================================== -
branches/2011/dev_r2787_LOCEAN3_TRA_TRP/NEMOGCM/NEMO/TOP_SRC/PISCES/p4zmort.F90
r2528 r2819 14 14 !! p4z_mort_init : Initialize the mortality params for phytoplankton 15 15 !!---------------------------------------------------------------------- 16 USE trc 17 USE oce_trc ! 18 USE trc ! 19 USE sms_pisces ! 20 USE p4zsink 21 USE prtctl_trc 16 USE oce_trc ! shared variables between ocean and passive tracers 17 USE trc ! passive tracers common variables 18 USE sms_pisces ! PISCES Source Minus Sink variables 19 USE p4zsink ! vertical flux of particulate matter due to sinking 20 USE prtctl_trc ! print control for debugging 22 21 23 22 IMPLICIT NONE … … 26 25 PUBLIC p4z_mort 27 26 PUBLIC p4z_mort_init 28 27 PUBLIC p4z_mort_alloc 29 28 30 29 !! * Shared module variables … … 81 80 !!--------------------------------------------------------------------- 82 81 83 84 #if defined key_diatrc 85 prodcal(:,:,:) = 0. !: Initialisation of calcite production variable 86 #endif 87 82 prodcal(:,:,:) = 0. !: calcite production variable set to zero 88 83 DO jk = 1, jpkm1 89 84 DO jj = 1, jpj 90 85 DO ji = 1, jpi 91 92 86 zcompaph = MAX( ( trn(ji,jj,jk,jpphy) - 1e-8 ), 0.e0 ) 93 87 zstep = xstep 94 88 # if defined key_degrad 95 zstep = xstep * facvol(ji,jj,jk) 96 # else 97 zstep = xstep 89 zstep = zstep * facvol(ji,jj,jk) 98 90 # endif 99 91 ! Squared mortality of Phyto similar to a sedimentation term during … … 117 109 tra(ji,jj,jk,jpnfe) = tra(ji,jj,jk,jpnfe) - zmortp * zfactfe 118 110 zprcaca = xfracal(ji,jj,jk) * zmortp 119 #if defined key_diatrc 111 112 ! calcite production 120 113 prodcal(ji,jj,jk) = prodcal(ji,jj,jk) + zprcaca ! prodcal=prodcal(nanophy)+prodcal(microzoo)+prodcal(mesozoo) 121 #endif 114 ! 122 115 zfracal = 0.5 * xfracal(ji,jj,jk) 123 116 tra(ji,jj,jk,jpdic) = tra(ji,jj,jk,jpdic) - zprcaca … … 177 170 ! sticky and coagulate to sink quickly out of the euphotic zone 178 171 ! ------------------------------------------------------------ 179 172 zstep = xstep 180 173 # if defined key_degrad 181 zstep = xstep * facvol(ji,jj,jk) 182 # else 183 zstep = xstep 174 zstep = zstep * facvol(ji,jj,jk) 184 175 # endif 185 176 ! Phytoplankton respiration … … 243 234 NAMELIST/nampismort/ wchl, wchld, mprat, mprat2, mpratm 244 235 245 REWIND( numnat ) ! read numnat246 READ ( numnat , nampismort )236 REWIND( numnatp ) ! read numnatp 237 READ ( numnatp, nampismort ) 247 238 248 239 IF(lwp) THEN ! control print … … 259 250 END SUBROUTINE p4z_mort_init 260 251 252 INTEGER FUNCTION p4z_mort_alloc() 253 !!---------------------------------------------------------------------- 254 !! *** ROUTINE p4z_mort_alloc *** 255 !!---------------------------------------------------------------------- 256 ALLOCATE( prodcal(jpi,jpj,jpk), STAT=p4z_mort_alloc ) 257 IF( p4z_mort_alloc /= 0 ) CALL ctl_warn('p4z_mort_alloc : failed to allocate arrays.') 258 259 END FUNCTION p4z_mort_alloc 260 261 261 #else 262 262 !!====================================================================== -
branches/2011/dev_r2787_LOCEAN3_TRA_TRP/NEMOGCM/NEMO/TOP_SRC/PISCES/p4zopt.F90
r2715 r2819 215 215 END DO 216 216 217 #if defined key_diatrc 218 # if ! defined key_iomput 219 ! save for outputs 220 trc2d(:,:, jp_pcs0_2d + 10) = heup(:,: ) * tmask(:,:,1) 221 trc3d(:,:,:,jp_pcs0_3d + 3) = etot(:,:,:) * tmask(:,:,:) 222 # else 223 ! write diagnostics 224 IF( jnt == nrdttrc ) then 225 CALL iom_put( "Heup", heup(:,: ) * tmask(:,:,1) ) ! euphotic layer deptht 226 CALL iom_put( "PAR" , etot(:,:,:) * tmask(:,:,:) ) ! Photosynthetically Available Radiation 217 IF( ln_diatrc ) THEN ! save output diagnostics 218 ! 219 IF( lk_iomput ) THEN 220 IF( jnt == nrdttrc ) THEN 221 CALL iom_put( "Heup", heup(:,: ) * tmask(:,:,1) ) ! euphotic layer deptht 222 CALL iom_put( "PAR" , etot(:,:,:) * tmask(:,:,:) ) ! Photosynthetically Available Radiation 223 ENDIF 224 ELSE 225 trc2d(:,:, jp_pcs0_2d + 10) = heup(:,: ) * tmask(:,:,1) 226 trc3d(:,:,:,jp_pcs0_3d + 3) = etot(:,:,:) * tmask(:,:,:) 227 ENDIF 228 ! 227 229 ENDIF 228 # endif229 #endif230 230 ! 231 231 IF( wrk_not_released(2, 1,2) .OR. & -
branches/2011/dev_r2787_LOCEAN3_TRA_TRP/NEMOGCM/NEMO/TOP_SRC/PISCES/p4zprod.F90
r2730 r2819 2 2 !!====================================================================== 3 3 !! *** MODULE p4zprod *** 4 !! TOP : PISCES4 !! TOP : Growth Rate of the two phytoplanktons groups 5 5 !!====================================================================== 6 6 !! History : 1.0 ! 2004 (O. Aumont) Original code … … 11 11 !! 'key_pisces' PISCES bio-model 12 12 !!---------------------------------------------------------------------- 13 !! p4z_prod : 14 !!---------------------------------------------------------------------- 15 USE trc 16 USE oce_trc ! 17 USE sms_pisces ! 18 USE prtctl_trc 19 USE p4zopt 20 USE p4zint 21 USE p4zlim 22 USE iom 13 !! p4z_prod : Compute the growth Rate of the two phytoplanktons groups 14 !! p4z_prod_init : Initialization of the parameters for growth 15 !! p4z_prod_alloc : Allocate variables for growth 16 !!---------------------------------------------------------------------- 17 USE oce_trc ! shared variables between ocean and passive tracers 18 USE trc ! passive tracers common variables 19 USE sms_pisces ! PISCES Source Minus Sink variables 20 USE p4zopt ! optical model 21 USE p4zlim ! Co-limitations of differents nutrients 22 USE prtctl_trc ! print control for debugging 23 USE iom ! I/O manager 23 24 24 25 IMPLICIT NONE … … 84 85 REAL(wp) :: zpislopen , zpislope2n 85 86 REAL(wp) :: zrum, zcodel, zargu, zval, zvol 86 #if defined key_diatrc87 87 REAL(wp) :: zrfact2 88 #endif89 88 CHARACTER (len=25) :: charout 90 89 !!--------------------------------------------------------------------- … … 108 107 109 108 ! Computation of the optimal production 110 # if defined key_degrad 111 prmax(:,:,:) = rday1 * tgfunc(:,:,:) * facvol(:,:,:) 112 # else 113 prmax(:,:,:) = rday1 * tgfunc(:,:,:) 114 # endif 109 prmax(:,:,:) = rday1 * tgfunc(:,:,:) 110 IF( lk_degrad ) prmax(:,:,:) = prmax(:,:,:) * facvol(:,:,:) 115 111 116 112 ! compute the day length depending on latitude and the day … … 321 317 ! Total primary production per year 322 318 323 #if defined key_degrad 324 tpp = tpp + glob_sum( ( zprorca(:,:,:) + zprorcad(:,:,:) ) * cvol(:,:,:) * facvol(:,:,:) )325 #else 326 tpp = tpp + glob_sum( ( zprorca(:,:,:) + zprorcad(:,:,:) ) * cvol(:,:,:) )327 #endif 328 329 IF( kt == nitend .AND. jnt == nrdttrc .AND. lwp) THEN319 IF( lk_degrad ) THEN 320 tpp = tpp + glob_sum( ( zprorca(:,:,:) + zprorcad(:,:,:) ) * cvol(:,:,:) * facvol(:,:,:) ) 321 ELSE 322 tpp = tpp + glob_sum( ( zprorca(:,:,:) + zprorcad(:,:,:) ) * cvol(:,:,:) ) 323 ENDIF 324 325 IF( kt == nitend .AND. jnt == nrdttrc ) THEN 330 326 WRITE(numout,*) 'Total PP (Gtc) :' 331 327 WRITE(numout,*) '-------------------- : ',tpp * 12. / 1.E12 … … 333 329 ENDIF 334 330 335 #if defined key_diatrc && ! defined key_iomput 336 ! Supplementary diagnostics 337 zrfact2 = 1.e3 * rfact2r 338 trc3d(:,:,:,jp_pcs0_3d + 4) = zprorca (:,:,:) * zrfact2 * tmask(:,:,:) 339 trc3d(:,:,:,jp_pcs0_3d + 5) = zprorcad(:,:,:) * zrfact2 * tmask(:,:,:) 340 trc3d(:,:,:,jp_pcs0_3d + 6) = zpronew (:,:,:) * zrfact2 * tmask(:,:,:) 341 trc3d(:,:,:,jp_pcs0_3d + 7) = zpronewd(:,:,:) * zrfact2 * tmask(:,:,:) 342 trc3d(:,:,:,jp_pcs0_3d + 8) = zprorcad(:,:,:) * zrfact2 * tmask(:,:,:) * zysopt(:,:,:) 343 trc3d(:,:,:,jp_pcs0_3d + 9) = zprofed (:,:,:) * zrfact2 * tmask(:,:,:) 331 IF( ln_diatrc ) THEN 332 ! 333 zrfact2 = 1.e3 * rfact2r 334 IF( jnt == nrdttrc ) THEN 335 CALL iom_put( "PPPHY" , zprorca (:,:,:) * zrfact2 * tmask(:,:,:) ) ! primary production by nanophyto 336 CALL iom_put( "PPPHY2", zprorcad(:,:,:) * zrfact2 * tmask(:,:,:) ) ! primary production by diatom 337 CALL iom_put( "PPNEWN", zpronew (:,:,:) * zrfact2 * tmask(:,:,:) ) ! new primary production by nanophyto 338 CALL iom_put( "PPNEWD", zpronewd(:,:,:) * zrfact2 * tmask(:,:,:) ) ! new primary production by diatom 339 CALL iom_put( "PBSi" , zprorcad(:,:,:) * zrfact2 * tmask(:,:,:) * zysopt(:,:,:) ) ! biogenic silica production 340 CALL iom_put( "PFeD" , zprofed (:,:,:) * zrfact2 * tmask(:,:,:) ) ! biogenic iron production by diatom 341 CALL iom_put( "PFeN" , zprofen (:,:,:) * zrfact2 * tmask(:,:,:) ) ! biogenic iron production by nanophyto 342 ENDIF 343 #if ! defined key_iomput 344 trc3d(:,:,:,jp_pcs0_3d + 4) = zprorca (:,:,:) * zrfact2 * tmask(:,:,:) 345 trc3d(:,:,:,jp_pcs0_3d + 5) = zprorcad(:,:,:) * zrfact2 * tmask(:,:,:) 346 trc3d(:,:,:,jp_pcs0_3d + 6) = zpronew (:,:,:) * zrfact2 * tmask(:,:,:) 347 trc3d(:,:,:,jp_pcs0_3d + 7) = zpronewd(:,:,:) * zrfact2 * tmask(:,:,:) 348 trc3d(:,:,:,jp_pcs0_3d + 8) = zprorcad(:,:,:) * zrfact2 * tmask(:,:,:) * zysopt(:,:,:) 349 trc3d(:,:,:,jp_pcs0_3d + 9) = zprofed (:,:,:) * zrfact2 * tmask(:,:,:) 344 350 # if ! defined key_kriest 345 trc3d(:,:,:,jp_pcs0_3d + 10) = zprofen (:,:,:) * zrfact2 * tmask(:,:,:)351 trc3d(:,:,:,jp_pcs0_3d + 10) = zprofen (:,:,:) * zrfact2 * tmask(:,:,:) 346 352 # endif 347 353 #endif 348 349 #if defined key_diatrc && defined key_iomput 350 zrfact2 = 1.e3 * rfact2r 351 IF ( jnt == nrdttrc ) then 352 CALL iom_put( "PPPHY" , zprorca (:,:,:) * zrfact2 * tmask(:,:,:) ) ! primary production by nanophyto 353 CALL iom_put( "PPPHY2", zprorcad(:,:,:) * zrfact2 * tmask(:,:,:) ) ! primary production by diatom 354 CALL iom_put( "PPNEWN", zpronew (:,:,:) * zrfact2 * tmask(:,:,:) ) ! new primary production by nanophyto 355 CALL iom_put( "PPNEWD", zpronewd(:,:,:) * zrfact2 * tmask(:,:,:) ) ! new primary production by diatom 356 CALL iom_put( "PBSi" , zprorcad(:,:,:) * zrfact2 * tmask(:,:,:) * zysopt(:,:,:) ) ! biogenic silica production 357 CALL iom_put( "PFeD" , zprofed (:,:,:) * zrfact2 * tmask(:,:,:) ) ! biogenic iron production by diatom 358 CALL iom_put( "PFeN" , zprofen (:,:,:) * zrfact2 * tmask(:,:,:) ) ! biogenic iron production by nanophyto 354 ! 359 355 ENDIF 360 #endif361 356 362 357 IF(ln_ctl) THEN ! print mean trends (used for debugging) … … 388 383 !!---------------------------------------------------------------------- 389 384 390 REWIND( numnat ) ! read numnat391 READ ( numnat , nampisprod )385 REWIND( numnatp ) ! read numnatp 386 READ ( numnatp, nampisprod ) 392 387 393 388 IF(lwp) THEN ! control print -
branches/2011/dev_r2787_LOCEAN3_TRA_TRP/NEMOGCM/NEMO/TOP_SRC/PISCES/p4zrem.F90
r2773 r2819 12 12 !! 'key_pisces' PISCES bio-model 13 13 !!---------------------------------------------------------------------- 14 !! p4z_rem : Compute remineralization/scavenging of organic compounds 15 !!---------------------------------------------------------------------- 16 USE trc 17 USE oce_trc ! 18 USE sms_pisces ! 19 USE prtctl_trc 20 USE p4zint 21 USE p4zopt 22 USE p4zmeso 23 USE p4zprod 24 USE p4zche 14 !! p4z_rem : Compute remineralization/scavenging of organic compounds 15 !! p4z_rem_init : Initialisation of parameters for remineralisation 16 !! p4z_rem_alloc : Allocate remineralisation variables 17 !!---------------------------------------------------------------------- 18 USE oce_trc ! shared variables between ocean and passive tracers 19 USE trc ! passive tracers common variables 20 USE sms_pisces ! PISCES Source Minus Sink variables 21 USE p4zopt ! optical model 22 USE p4zche ! chemical model 23 USE p4zprod ! Growth rate of the 2 phyto groups 24 USE p4zmeso ! Sources and sinks of mesozooplankton 25 USE prtctl_trc ! print control for debugging 25 26 26 27 IMPLICIT NONE … … 61 62 USE wrk_nemo, ONLY: wrk_in_use, wrk_not_released 62 63 USE wrk_nemo, ONLY: ztempbac => wrk_2d_1 63 USE wrk_nemo, ONLY: zdepbac => wrk_3d_2 64 USE wrk_nemo, ONLY: zdepbac => wrk_3d_2, zolimi => wrk_3d_3 64 65 ! 65 66 INTEGER, INTENT(in) :: kt ! ocean time step … … 117 118 DO jj = 1, jpj 118 119 DO ji = 1, jpi 120 zstep = xstep 119 121 # if defined key_degrad 120 zstep = xstep * facvol(ji,jj,jk) 121 # else 122 zstep = xstep 122 zstep = zstep * facvol(ji,jj,jk) 123 123 # endif 124 124 ! DOC ammonification. Depends on depth, phytoplankton biomass … … 153 153 DO jj = 1, jpj 154 154 DO ji = 1, jpi 155 zstep = xstep 155 156 # if defined key_degrad 156 zstep = xstep * facvol(ji,jj,jk) 157 # else 158 zstep = xstep 157 zstep = zstep * facvol(ji,jj,jk) 159 158 # endif 160 159 ! NH4 nitrification to NO3. Ceased for oxygen concentrations … … 214 213 DO jj = 1, jpj 215 214 DO ji = 1, jpi 215 zstep = xstep 216 216 # if defined key_degrad 217 zstep = xstep * facvol(ji,jj,jk) 218 # else 219 zstep = xstep 217 zstep = zstep * facvol(ji,jj,jk) 220 218 # endif 221 219 ! POC disaggregation by turbulence and bacterial activity. … … 266 264 DO jj = 1, jpj 267 265 DO ji = 1, jpi 266 zstep = xstep 268 267 # if defined key_degrad 269 zstep = xstep * facvol(ji,jj,jk) 270 # else 271 zstep = xstep 268 zstep = zstep * facvol(ji,jj,jk) 272 269 # endif 273 270 ! Remineralization rate of BSi depedant on T and saturation … … 300 297 !CDIR NOVERRCHK 301 298 DO ji = 1, jpi 299 zstep = xstep 302 300 # if defined key_degrad 303 zstep = xstep * facvol(ji,jj,jk) 304 # else 305 zstep = xstep 301 zstep = zstep * facvol(ji,jj,jk) 306 302 # endif 307 303 ! Compute de different ratios for scavenging of iron … … 414 410 !!---------------------------------------------------------------------- 415 411 416 REWIND( numnat ) ! read numnat417 READ ( numnat , nampisrem )412 REWIND( numnatp ) ! read numnatp 413 READ ( numnatp, nampisrem ) 418 414 419 415 IF(lwp) THEN ! control print -
branches/2011/dev_r2787_LOCEAN3_TRA_TRP/NEMOGCM/NEMO/TOP_SRC/PISCES/p4zsed.F90
r2774 r2819 15 15 !! p4z_sed_init : Initialization of p4z_sed 16 16 !!---------------------------------------------------------------------- 17 USE trc 18 USE oce_trc ! 19 USE sms_pisces 20 USE prtctl_trc 21 USE p4zbio 22 USE p4zint 23 USE p4zopt 24 USE p4zsink 25 USE p4zrem 26 USE p4zlim 27 USE iom 28 17 USE oce_trc ! shared variables between ocean and passive tracers 18 USE trc ! passive tracers common variables 19 USE sms_pisces ! PISCES Source Minus Sink variables 20 USE p4zsink ! vertical flux of particulate matter due to sinking 21 USE p4zopt ! optical model 22 USE p4zlim ! Co-limitations of differents nutrients 23 USE p4zrem ! Remineralisation of organic matter 24 USE prtctl_trc ! print control for debugging 25 USE iom ! I/O manager 29 26 30 27 IMPLICIT NONE … … 247 244 IF( zlim <= 0.2 ) zlim = 0.01 248 245 znitrpot(ji,jj,jk) = MAX( 0.e0, ( 0.6 * tgfunc(ji,jj,jk) - 2.15 ) * rday1 ) & 246 & * zlim * rfact2 * trn(ji,jj,jk,jpfer) & 249 247 # if defined key_degrad 250 & * facvol(ji,jj,jk) &248 & * facvol(ji,jj,jk) 251 249 # endif 252 & * zlim * rfact2 * trn(ji,jj,jk,jpfer) & 253 & / ( conc3 + trn(ji,jj,jk,jpfer) ) * ( 1.- EXP( -etot(ji,jj,jk) / 50.) ) 250 & / ( conc3 + trn(ji,jj,jk,jpfer) ) * ( 1.- EXP( -etot(ji,jj,jk) / 50.) ) 254 251 END DO 255 252 END DO … … 272 269 END DO 273 270 274 #if defined key_diatrc 275 zfact = 1.e+3 * rfact2r 276 # if ! defined key_iomput 277 trc2d(:,:,jp_pcs0_2d + 11) = zirondep(:,:,1) * zfact * fse3t(:,:,1) * tmask(:,:,1) 278 trc2d(:,:,jp_pcs0_2d + 12) = znitrpot(:,:,1) * 1.e-7 * zfact * fse3t(:,:,1) * tmask(:,:,1) 279 # else 280 zwork (:,:) = ( zirondep(:,:,1) + ironsed(:,:,1) * rfact2 ) * zfact * fse3t(:,:,1) * tmask(:,:,1) 281 zwork1(:,:) = znitrpot(:,:,1) * 1.e-7 * zfact * fse3t(:,:,1) * tmask(:,:,1) 282 IF( jnt == nrdttrc ) THEN 283 CALL iom_put( "Irondep", zwork ) ! surface downward net flux of iron 284 CALL iom_put( "Nfix" , zwork1 ) ! nitrogen fixation at surface 271 IF( ln_diatrc ) THEN 272 ! 273 zfact = 1.e+3 * rfact2r 274 zwork (:,:) = ( zirondep(:,:,1) + ironsed(:,:,1) * rfact2 ) * zfact * fse3t(:,:,1) * tmask(:,:,1) 275 zwork1(:,:) = znitrpot(:,:,1) * 1.e-7 * zfact * fse3t(:,:,1) * tmask(:,:,1) 276 IF( jnt == nrdttrc ) THEN 277 CALL iom_put( "Irondep", zwork ) ! surface downward net flux of iron 278 CALL iom_put( "Nfix" , zwork1 ) ! nitrogen fixation at surface 279 ENDIF 280 # if ! defined key_iomput 281 trc2d(:,:,jp_pcs0_2d + 11) = zirondep(:,:,1) * zfact * fse3t(:,:,1) * tmask(:,:,1) 282 trc2d(:,:,jp_pcs0_2d + 12) = znitrpot(:,:,1) * 1.e-7 * zfact * fse3t(:,:,1) * tmask(:,:,1) 283 # endif 284 ! 285 285 ENDIF 286 # endif287 #endif288 286 ! 289 287 IF(ln_ctl) THEN ! print mean trends (used for debugging) … … 355 353 356 354 END SUBROUTINE p4z_sbc 357 358 355 359 356 SUBROUTINE p4z_sed_init … … 385 382 CALL ctl_stop('p4z_sed_init: requested workspace arrays unavailable') ; RETURN 386 383 END IF 387 ! 388 REWIND( numnat ) ! read numnat389 READ ( numnat , nampissed )384 385 REWIND( numnatp ) ! read numnatp 386 READ ( numnatp, nampissed ) 390 387 391 388 IF(lwp) THEN -
branches/2011/dev_r2787_LOCEAN3_TRA_TRP/NEMOGCM/NEMO/TOP_SRC/PISCES/p4zsink.F90
r2715 r2819 2 2 !!====================================================================== 3 3 !! *** MODULE p4zsink *** 4 !! TOP : PISCES Computevertical flux of particulate matter due to gravitational sinking4 !! TOP : PISCES vertical flux of particulate matter due to gravitational sinking 5 5 !!====================================================================== 6 6 !! History : 1.0 ! 2004 (O. Aumont) Original code … … 9 9 !!---------------------------------------------------------------------- 10 10 !! p4z_sink : Compute vertical flux of particulate matter due to gravitational sinking 11 !! p4z_sink_init : Unitialisation of sinking speed parameters 12 !! p4z_sink_alloc : Allocate sinking speed variables 11 13 !!---------------------------------------------------------------------- 12 USE trc13 USE oce_trc !14 USE sms_pisces 15 USE prtctl_trc 16 USE iom 14 USE oce_trc ! shared variables between ocean and passive tracers 15 USE trc ! passive tracers common variables 16 USE sms_pisces ! PISCES Source Minus Sink variables 17 USE prtctl_trc ! print control for debugging 18 USE iom ! I/O manager 17 19 18 20 IMPLICIT NONE … … 91 93 REAL(wp) :: zdiv , zdiv1, zdiv2, zdiv3, zdiv4, zdiv5 92 94 REAL(wp) :: zval1, zval2, zval3, zval4 93 #if defined key_diatrc94 95 REAL(wp) :: zrfact2 95 96 INTEGER :: ik1 96 #endif97 97 CHARACTER (len=25) :: charout 98 98 !!--------------------------------------------------------------------- … … 193 193 & * (zeps-1)/zdiv1 + 3.*(zfm*xkr_mass_max-xkr_mass_min) & 194 194 & * (zfm*xkr_mass_max**2-xkr_mass_min**2) & 195 & * (zeps-1.)**2/(zdiv2*zdiv3)) & 196 # if defined key_degrad 197 & *facvol(ji,jj,jk) & 198 # endif 199 & ) 195 & * (zeps-1.)**2/(zdiv2*zdiv3)) ) 200 196 201 197 zagg2 = ( 2*0.163*trn(ji,jj,jk,jpnum)**2*zfm* & … … 205 201 & +xkr_mass_min**3*(zeps-1)/zdiv1) & 206 202 & -zfm*xkr_mass_max**3*(1.+3.*((zeps-1.)/ & 207 & (zeps-2.)+(zeps-1.)/zdiv3)+(zeps-1.)/zdiv1)) & 208 # if defined key_degrad 209 & *facvol(ji,jj,jk) & 210 # endif 211 & ) 212 213 zagg3 = ( 0.163*trn(ji,jj,jk,jpnum)**2*zfm**2*8. * xkr_mass_max**3 & 214 # if defined key_degrad 215 & *facvol(ji,jj,jk) & 216 # endif 217 & ) 218 203 & (zeps-2.)+(zeps-1.)/zdiv3)+(zeps-1.)/zdiv1)) ) 204 205 zagg3 = ( 0.163*trn(ji,jj,jk,jpnum)**2*zfm**2*8. * xkr_mass_max**3 ) 206 207 IF( lk_degrad ) THEN 208 zagg1 = zagg1 * facvol(ji,jj,jk) 209 zagg2 = zagg2 * facvol(ji,jj,jk) 210 zagg3 = zagg3 * facvol(ji,jj,jk) 211 ENDIF 219 212 zaggsh = ( zagg1 + zagg2 + zagg3 ) * rfact2 * xdiss(ji,jj,jk) / 1000. 220 213 … … 228 221 & -(1.-zfm)/(zdiv*(zeps-1.)))- & 229 222 & ((zfm*zfm*xkr_mass_max**2*zsm-xkr_mass_min**2) & 230 & *xkr_eta)/(zdiv*zdiv3*zdiv5) ) & 231 # if defined key_degrad 232 & *facvol(ji,jj,jk) & 233 # endif 234 & ) 223 & *xkr_eta)/(zdiv*zdiv3*zdiv5) ) ) 235 224 236 225 zagg5 = ( 2.*3.141*0.125*trn(ji,jj,jk,jpnum)**2 & … … 238 227 & *(zsm*(xkr_mass_min**2-zfm*xkr_mass_max**2) & 239 228 & /zdiv3-(xkr_mass_min**2-zfm*zsm*xkr_mass_max**2) & 240 & /zdiv) &229 & /zdiv) ) 241 230 # if defined key_degrad 242 & *facvol(ji,jj,jk) & 231 zagg4 = zagg4 * facvol(ji,jj,jk) 232 zagg5 = zagg5 * facvol(ji,jj,jk) 243 233 # endif 244 & )245 246 234 zaggsi = ( zagg4 + zagg5 ) * xstep / 10. 247 235 … … 254 242 & + 1018. * trn(ji,jj,jk,jppoc) ) * xstep & 255 243 # if defined key_degrad 256 & * facvol(ji,jj,jk) &244 & * facvol(ji,jj,jk) 257 245 # endif 258 246 & * xdiss(ji,jj,jk) * trn(ji,jj,jk,jpdoc) … … 268 256 END DO 269 257 270 #if defined key_diatrc 271 zrfact2 = 1.e3 * rfact2r272 ik1 = iksed + 1273 # if ! defined key_iomput 274 trc2d(:,: ,jp_pcs0_2d + 4) = sinking (:,:,ik1) * zrfact2 * tmask(:,:,1)275 trc2d(:,: ,jp_pcs0_2d + 5) = sinking2(:,:,ik1) * zrfact2 * tmask(:,:,1)276 trc2d(:,: ,jp_pcs0_2d + 6) = sinkfer (:,:,ik1) * zrfact2 * tmask(:,:,1)277 trc2d(:,: ,jp_pcs0_2d + 7) = sinksil (:,:,ik1) * zrfact2 * tmask(:,:,1)278 trc2d(:,: ,jp_pcs0_2d + 8) = sinkcal (:,:,ik1) * zrfact2 * tmask(:,:,1)279 trc3d(:,:,:,jp_pcs0_3d + 11) = sinking (:,:,:) * zrfact2 * tmask(:,:,:)280 trc3d(:,:,:,jp_pcs0_3d + 12) = sinking2(:,:,:) * zrfact2 * tmask(:,:,:)281 trc3d(:,:,:,jp_pcs0_3d + 13) = sinksil (:,:,:) * zrfact2 * tmask(:,:,:)282 trc3d(:,:,:,jp_pcs0_3d + 14) = sinkcal (:,:,:) * zrfact2 * tmask(:,:,:)283 trc3d(:,:,:,jp_pcs0_3d + 15) = znum3d (:,:,:) * tmask(:,:,:)284 trc3d(:,:,:,jp_pcs0_3d + 16) = wsbio3 (:,:,:) * tmask(:,:,:)285 trc3d(:,:,:,jp_pcs0_3d + 17) = wsbio4 (:,:,:) * tmask(:,:,:)286 #else 287 IF( jnt == nrdttrc ) then288 CALL iom_put( "POCFlx" , sinking (:,:,:) * zrfact2 * tmask(:,:,:) ) ! POC export289 CALL iom_put( "NumFlx" , sinking2 (:,:,:) * zrfact2 * tmask(:,:,:) ) ! Num export290 CALL iom_put( "SiFlx" , sinksil (:,:,:) * zrfact2 * tmask(:,:,:) ) ! Silica export291 CALL iom_put( "CaCO3Flx", sinkcal (:,:,:) * zrfact2 * tmask(:,:,:) ) ! Calcite export292 CALL iom_put( "xnum" , znum3d (:,:,:) * tmask(:,:,:) ) ! Number of particles in aggregats293 CALL iom_put( "W1" , wsbio3 (:,:,:) * tmask(:,:,:) ) ! sinking speed of POC294 CALL iom_put( "W2" , wsbio4 (:,:,:) * tmask(:,:,:) ) ! sinking speed of aggregats295 CALL iom_put( "PMO" , sinking (:,:,ik1) * zrfact2 * tmask(:,:,1) ) ! POC export at 100m296 CALL iom_put( "PMO2" , sinking2(:,:,ik1) * zrfact2 * tmask(:,:,1) ) ! Num export at 100m297 CALL iom_put( "ExpFe1" , sinkfer (:,:,ik1) * zrfact2 * tmask(:,:,1) ) ! Export of iron at 100m298 CALL iom_put( "ExpSi" , sinksil (:,:,ik1) * zrfact2 * tmask(:,:,1) ) ! export of silica at 100m299 CALL iom_put( "ExpCaCO3", sinkcal (:,:,ik1) * zrfact2 * tmask(:,:,1) ) ! export of calcite at 100m300 ENDIF301 # 302 303 #endif 258 IF( ln_diatrc ) THEN 259 ! 260 ik1 = iksed + 1 261 zrfact2 = 1.e3 * rfact2r 262 IF( jnt == nrdttrc ) THEN 263 CALL iom_put( "POCFlx" , sinking (:,:,:) * zrfact2 * tmask(:,:,:) ) ! POC export 264 CALL iom_put( "NumFlx" , sinking2 (:,:,:) * zrfact2 * tmask(:,:,:) ) ! Num export 265 CALL iom_put( "SiFlx" , sinksil (:,:,:) * zrfact2 * tmask(:,:,:) ) ! Silica export 266 CALL iom_put( "CaCO3Flx", sinkcal (:,:,:) * zrfact2 * tmask(:,:,:) ) ! Calcite export 267 CALL iom_put( "xnum" , znum3d (:,:,:) * tmask(:,:,:) ) ! Number of particles in aggregats 268 CALL iom_put( "W1" , wsbio3 (:,:,:) * tmask(:,:,:) ) ! sinking speed of POC 269 CALL iom_put( "W2" , wsbio4 (:,:,:) * tmask(:,:,:) ) ! sinking speed of aggregats 270 CALL iom_put( "PMO" , sinking (:,:,ik1) * zrfact2 * tmask(:,:,1) ) ! POC export at 100m 271 CALL iom_put( "PMO2" , sinking2(:,:,ik1) * zrfact2 * tmask(:,:,1) ) ! Num export at 100m 272 CALL iom_put( "ExpFe1" , sinkfer (:,:,ik1) * zrfact2 * tmask(:,:,1) ) ! Export of iron at 100m 273 CALL iom_put( "ExpSi" , sinksil (:,:,ik1) * zrfact2 * tmask(:,:,1) ) ! export of silica at 100m 274 CALL iom_put( "ExpCaCO3", sinkcal (:,:,ik1) * zrfact2 * tmask(:,:,1) ) ! export of calcite at 100m 275 ENDIF 276 # if ! defined key_iomput 277 trc2d(:,: ,jp_pcs0_2d + 4) = sinking (:,:,ik1) * zrfact2 * tmask(:,:,1) 278 trc2d(:,: ,jp_pcs0_2d + 5) = sinking2(:,:,ik1) * zrfact2 * tmask(:,:,1) 279 trc2d(:,: ,jp_pcs0_2d + 6) = sinkfer (:,:,ik1) * zrfact2 * tmask(:,:,1) 280 trc2d(:,: ,jp_pcs0_2d + 7) = sinksil (:,:,ik1) * zrfact2 * tmask(:,:,1) 281 trc2d(:,: ,jp_pcs0_2d + 8) = sinkcal (:,:,ik1) * zrfact2 * tmask(:,:,1) 282 trc3d(:,:,:,jp_pcs0_3d + 11) = sinking (:,:,:) * zrfact2 * tmask(:,:,:) 283 trc3d(:,:,:,jp_pcs0_3d + 12) = sinking2(:,:,:) * zrfact2 * tmask(:,:,:) 284 trc3d(:,:,:,jp_pcs0_3d + 13) = sinksil (:,:,:) * zrfact2 * tmask(:,:,:) 285 trc3d(:,:,:,jp_pcs0_3d + 14) = sinkcal (:,:,:) * zrfact2 * tmask(:,:,:) 286 trc3d(:,:,:,jp_pcs0_3d + 15) = znum3d (:,:,:) * tmask(:,:,:) 287 trc3d(:,:,:,jp_pcs0_3d + 16) = wsbio3 (:,:,:) * tmask(:,:,:) 288 trc3d(:,:,:,jp_pcs0_3d + 17) = wsbio4 (:,:,:) * tmask(:,:,:) 289 # endif 290 ! 291 ENDIF 304 292 ! 305 293 IF(ln_ctl) THEN ! print mean trends (used for debugging) … … 335 323 !!---------------------------------------------------------------------- 336 324 ! 337 REWIND( numnat ) ! read nampiskrs338 READ ( numnat , nampiskrs )325 REWIND( numnatp ) ! read nampiskrs 326 READ ( numnatp, nampiskrs ) 339 327 340 328 IF(lwp) THEN … … 459 447 REAL(wp) :: zagg , zaggfe, zaggdoc, zaggdoc2 460 448 REAL(wp) :: zfact, zwsmax, zstep 461 #if defined key_diatrc462 449 REAL(wp) :: zrfact2 463 450 INTEGER :: ik1 464 #endif465 451 CHARACTER (len=25) :: charout 466 452 !!--------------------------------------------------------------------- … … 526 512 DO jj = 1, jpj 527 513 DO ji = 1, jpi 514 ! 515 zstep = xstep 528 516 # if defined key_degrad 529 zstep = xstep * facvol(ji,jj,jk) 530 # else 531 zstep = xstep 517 zstep = zstep * facvol(ji,jj,jk) 532 518 # endif 533 519 zfact = zstep * xdiss(ji,jj,jk) … … 560 546 END DO 561 547 562 #if defined key_diatrc 563 zrfact2 = 1.e3 * rfact2r 564 ik1 = iksed + 1 565 # if ! defined key_iomput 566 trc2d(:,:,jp_pcs0_2d + 4) = sinking (:,:,ik1) * zrfact2 * tmask(:,:,1) 567 trc2d(:,:,jp_pcs0_2d + 5) = sinking2(:,:,ik1) * zrfact2 * tmask(:,:,1) 568 trc2d(:,:,jp_pcs0_2d + 6) = sinkfer (:,:,ik1) * zrfact2 * tmask(:,:,1) 569 trc2d(:,:,jp_pcs0_2d + 7) = sinkfer2(:,:,ik1) * zrfact2 * tmask(:,:,1) 570 trc2d(:,:,jp_pcs0_2d + 8) = sinksil (:,:,ik1) * zrfact2 * tmask(:,:,1) 571 trc2d(:,:,jp_pcs0_2d + 9) = sinkcal (:,:,ik1) * zrfact2 * tmask(:,:,1) 572 # else 573 IF( jnt == nrdttrc ) then 574 CALL iom_put( "EPC100" , ( sinking(:,:,ik1) + sinking2(:,:,ik1) ) * zrfact2 * tmask(:,:,1) ) ! Export of carbon at 100m 575 CALL iom_put( "EPFE100" , ( sinkfer(:,:,ik1) + sinkfer2(:,:,ik1) ) * zrfact2 * tmask(:,:,1) ) ! Export of iron at 100m 576 CALL iom_put( "EPCAL100", sinkcal(:,:,ik1) * zrfact2 * tmask(:,:,1) ) ! Export of calcite at 100m 577 CALL iom_put( "EPSI100" , sinksil(:,:,ik1) * zrfact2 * tmask(:,:,1) ) ! Export of biogenic silica at 100m 548 IF( ln_diatrc ) THEN 549 ! 550 zrfact2 = 1.e3 * rfact2r 551 ik1 = iksed + 1 552 IF( jnt == nrdttrc ) THEN 553 CALL iom_put( "EPC100" , ( sinking(:,:,ik1) + sinking2(:,:,ik1) ) * zrfact2 * tmask(:,:,1) ) ! Export of carbon at 100m 554 CALL iom_put( "EPFE100" , ( sinkfer(:,:,ik1) + sinkfer2(:,:,ik1) ) * zrfact2 * tmask(:,:,1) ) ! Export of iron at 100m 555 CALL iom_put( "EPCAL100", sinkcal(:,:,ik1) * zrfact2 * tmask(:,:,1) ) ! Export of calcite at 100m 556 CALL iom_put( "EPSI100" , sinksil(:,:,ik1) * zrfact2 * tmask(:,:,1) ) ! Export of biogenic silica at 100m 557 ENDIF 558 # if ! defined key_iomput 559 trc2d(:,:,jp_pcs0_2d + 4) = sinking (:,:,ik1) * zrfact2 * tmask(:,:,1) 560 trc2d(:,:,jp_pcs0_2d + 5) = sinking2(:,:,ik1) * zrfact2 * tmask(:,:,1) 561 trc2d(:,:,jp_pcs0_2d + 6) = sinkfer (:,:,ik1) * zrfact2 * tmask(:,:,1) 562 trc2d(:,:,jp_pcs0_2d + 7) = sinkfer2(:,:,ik1) * zrfact2 * tmask(:,:,1) 563 trc2d(:,:,jp_pcs0_2d + 8) = sinksil (:,:,ik1) * zrfact2 * tmask(:,:,1) 564 trc2d(:,:,jp_pcs0_2d + 9) = sinkcal (:,:,ik1) * zrfact2 * tmask(:,:,1) 565 # endif 566 ! 578 567 ENDIF 579 #endif580 #endif581 568 ! 582 569 IF(ln_ctl) THEN ! print mean trends (used for debugging) … … 630 617 631 618 DO jk = 1, jpkm1 632 # if defined key_degrad 633 zwsink2(:,:,jk+1) = -pwsink(:,:,jk) / rday * tmask(:,:,jk+1) * facvol(:,:,jk) 634 # else 635 zwsink2(:,:,jk+1) = -pwsink(:,:,jk) / rday * tmask(:,:,jk+1) 636 # endif 619 zwsink2(:,:,jk+1) = -pwsink(:,:,jk) / rday * tmask(:,:,jk+1) 637 620 END DO 638 621 zwsink2(:,:,1) = 0.e0 622 IF( lk_degrad ) THEN 623 zwsink2(:,:,:) = zwsink2(:,:,:) * facvol(:,:,:) 624 ENDIF 639 625 640 626 -
branches/2011/dev_r2787_LOCEAN3_TRA_TRP/NEMOGCM/NEMO/TOP_SRC/PISCES/par_pisces.F90
r2528 r2819 29 29 LOGICAL, PUBLIC, PARAMETER :: lk_kriest = .TRUE. !: Kriest flag 30 30 INTEGER, PUBLIC, PARAMETER :: jp_pisces = 23 !: number of passive tracers 31 INTEGER, PUBLIC, PARAMETER :: jp_pisces_2d = 13 !: additional 2d output ('key_diatrc')32 INTEGER, PUBLIC, PARAMETER :: jp_pisces_3d = 18 !: additional 3d output ('key_diatrc')31 INTEGER, PUBLIC, PARAMETER :: jp_pisces_2d = 13 !: additional 2d output 32 INTEGER, PUBLIC, PARAMETER :: jp_pisces_3d = 18 !: additional 3d output 33 33 INTEGER, PUBLIC, PARAMETER :: jp_pisces_trd = 1 !: number of sms trends for PISCES 34 34 … … 67 67 LOGICAL, PUBLIC, PARAMETER :: lk_kriest = .FALSE. !: Kriest flag 68 68 INTEGER, PUBLIC, PARAMETER :: jp_pisces = 24 !: number of PISCES passive tracers 69 INTEGER, PUBLIC, PARAMETER :: jp_pisces_2d = 13 !: additional 2d output ('key_diatrc')70 INTEGER, PUBLIC, PARAMETER :: jp_pisces_3d = 11 !: additional 3d output ('key_diatrc')69 INTEGER, PUBLIC, PARAMETER :: jp_pisces_2d = 13 !: additional 2d output 70 INTEGER, PUBLIC, PARAMETER :: jp_pisces_3d = 11 !: additional 3d output 71 71 INTEGER, PUBLIC, PARAMETER :: jp_pisces_trd = 1 !: number of sms trends for PISCES 72 72 -
branches/2011/dev_r2787_LOCEAN3_TRA_TRP/NEMOGCM/NEMO/TOP_SRC/PISCES/sms_pisces.F90
r2715 r2819 16 16 IMPLICIT NONE 17 17 PUBLIC 18 19 INTEGER :: numnatp 18 20 19 21 !!* Time variables … … 61 63 REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: xlimbac !: ?? 62 64 REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: xdiss !: ?? 63 #if defined key_diatrc64 65 REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: prodcal !: Calcite production 65 66 REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: grazing !: Total zooplankton grazing 66 #endif67 67 68 68 !!* Variable for chemistry of the CO2 cycle … … 74 74 REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: borat !: ??? 75 75 REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: hi !: ??? 76 77 !!* Temperature dependancy of SMS terms 78 REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: tgfunc !: Temp. dependancy of various biological rates 79 REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: tgfunc2 !: Temp. dependancy of mesozooplankton rates 76 80 77 81 !!* Array used to indicate negative tracer values … … 98 102 !!---------------------------------------------------------------------- 99 103 USE lib_mpp , ONLY: ctl_warn 100 INTEGER :: ierr( 5) ! Local variables104 INTEGER :: ierr(6) ! Local variables 101 105 !!---------------------------------------------------------------------- 102 106 ierr(:) = 0 103 107 ! 104 108 !* Biological fluxes for light 105 ALLOCATE( neln(jpi,jpj), heup(jpi,jpj), 109 ALLOCATE( neln(jpi,jpj), heup(jpi,jpj), STAT=ierr(1) ) 106 110 ! 107 111 !* Biological fluxes for primary production 108 ALLOCATE( xksimax(jpi,jpj) , xksi(jpi,jpj) , 109 & xnanono3(jpi,jpj,jpk), xdiatno3(jpi,jpj,jpk), 110 & xnanonh4(jpi,jpj,jpk), xdiatnh4(jpi,jpj,jpk), 111 & xlimphy (jpi,jpj,jpk), xlimdia (jpi,jpj,jpk), 112 & concdfe (jpi,jpj,jpk), concnfe (jpi,jpj,jpk), 112 ALLOCATE( xksimax(jpi,jpj) , xksi(jpi,jpj) , & 113 & xnanono3(jpi,jpj,jpk), xdiatno3(jpi,jpj,jpk), & 114 & xnanonh4(jpi,jpj,jpk), xdiatnh4(jpi,jpj,jpk), & 115 & xlimphy (jpi,jpj,jpk), xlimdia (jpi,jpj,jpk), & 116 & concdfe (jpi,jpj,jpk), concnfe (jpi,jpj,jpk), STAT=ierr(2) ) 113 117 ! 114 118 !* SMS for the organic matter 115 ALLOCATE( xfracal (jpi,jpj,jpk), nitrfac (jpi,jpj,jpk), & 116 #if defined key_diatrc 117 & prodcal(jpi,jpj,jpk) , grazing(jpi,jpj,jpk) , & 118 #endif 119 & xlimbac (jpi,jpj,jpk), xdiss(jpi,jpj,jpk) , STAT=ierr(3) ) 119 ALLOCATE( xfracal (jpi,jpj,jpk), nitrfac (jpi,jpj,jpk), & 120 & xlimbac (jpi,jpj,jpk), xdiss(jpi,jpj,jpk) , STAT=ierr(3) ) 120 121 ! 121 122 !* Variable for chemistry of the CO2 cycle 122 ALLOCATE( akb3(jpi,jpj,jpk), ak13(jpi,jpj,jpk) , & 123 & ak23(jpi,jpj,jpk), aksp(jpi,jpj,jpk) , & 124 & akw3(jpi,jpj,jpk), borat(jpi,jpj,jpk), hi(jpi,jpj,jpk), STAT=ierr(4) ) 123 ALLOCATE( akb3(jpi,jpj,jpk) , ak13(jpi,jpj,jpk) , & 124 & ak23(jpi,jpj,jpk) , aksp(jpi,jpj,jpk) , & 125 & akw3(jpi,jpj,jpk) , borat(jpi,jpj,jpk) , & 126 & hi (jpi,jpj,jpk) , STAT=ierr(4) ) 127 ! 128 !* Temperature dependancy of SMS terms 129 ALLOCATE( tgfunc(jpi,jpj,jpk) , tgfunc2(jpi,jpj,jpk) , STAT=ierr(5) ) 125 130 ! 126 131 !* Array used to indicate negative tracer values 127 ALLOCATE( xnegtr(jpi,jpj,jpk) , STAT=ierr(5) )132 ALLOCATE( xnegtr(jpi,jpj,jpk) , STAT=ierr(6) ) 128 133 ! 129 134 sms_pisces_alloc = MAXVAL( ierr ) -
branches/2011/dev_r2787_LOCEAN3_TRA_TRP/NEMOGCM/NEMO/TOP_SRC/PISCES/trcini_pisces.F90
r2715 r2819 17 17 !!---------------------------------------------------------------------- 18 18 USE par_trc ! TOP parameters 19 USE sms_pisces ! Source Minus Sink variables 20 USE trc 21 USE oce_trc ! ocean variables 22 USE p4zche 23 USE p4zche ! 24 USE p4zsink ! 25 USE p4zopt ! 26 USE p4zprod ! 27 USE p4zrem ! 28 USE p4zsed ! 29 USE p4zflx ! 19 USE oce_trc ! shared variables between ocean and passive tracers 20 USE trc ! passive tracers common variables 21 USE sms_pisces ! PISCES Source Minus Sink variables 22 USE p4zche ! Chemical model 23 USE p4zsink ! vertical flux of particulate matter due to sinking 24 USE p4zopt ! optical model 25 USE p4zrem ! Remineralisation of organic matter 26 USE p4zflx ! Gas exchange 27 USE p4zsed ! Sedimentation 30 28 31 29 IMPLICIT NONE … … 136 134 !! ** Purpose : Allocate all the dynamic arrays of PISCES 137 135 !!---------------------------------------------------------------------- 138 USE p4zint , ONLY : p4z_int_alloc 139 USE p4zsink, ONLY : p4z_sink_alloc 140 USE p4zopt , ONLY : p4z_opt_alloc 141 USE p4zprod, ONLY : p4z_prod_alloc 142 USE p4zrem , ONLY : p4z_rem_alloc 143 USE p4zsed , ONLY : p4z_sed_alloc 144 USE p4zflx , ONLY : p4z_flx_alloc 136 USE p4zsink , ONLY : p4z_sink_alloc 137 USE p4zopt , ONLY : p4z_opt_alloc 138 USE p4zprod , ONLY : p4z_prod_alloc 139 USE p4zmort , ONLY : p4z_mort_alloc 140 USE p4zmicro, ONLY : p4z_micro_alloc 141 USE p4zrem , ONLY : p4z_rem_alloc 142 USE p4zsed , ONLY : p4z_sed_alloc 143 USE p4zflx , ONLY : p4z_flx_alloc 145 144 ! 146 145 INTEGER :: ierr … … 148 147 ! 149 148 ierr = sms_pisces_alloc() ! Start of PISCES-related alloc routines... 150 ierr = ierr + p4z_che_alloc() 151 ierr = ierr + p4z_int_alloc() 152 ierr = ierr + p4z_sink_alloc() 153 ierr = ierr + p4z_opt_alloc() 154 ierr = ierr + p4z_prod_alloc() 155 ierr = ierr + p4z_rem_alloc() 156 ierr = ierr + p4z_sed_alloc() 157 ierr = ierr + p4z_flx_alloc() 149 ierr = ierr + p4z_che_alloc() 150 ierr = ierr + p4z_sink_alloc() 151 ierr = ierr + p4z_opt_alloc() 152 ierr = ierr + p4z_prod_alloc() 153 ierr = ierr + p4z_mort_alloc() 154 ierr = ierr + p4z_micro_alloc() 155 ierr = ierr + p4z_rem_alloc() 156 ierr = ierr + p4z_sed_alloc() 157 ierr = ierr + p4z_flx_alloc() 158 158 ! 159 159 IF( lk_mpp ) CALL mpp_sum( ierr ) -
branches/2011/dev_r2787_LOCEAN3_TRA_TRP/NEMOGCM/NEMO/TOP_SRC/PISCES/trcnam_pisces.F90
r2715 r2819 19 19 USE trc ! TOP variables 20 20 USE sms_pisces ! sms trends 21 USE iom ! I/O manager 21 22 22 23 … … 46 47 !!---------------------------------------------------------------------- 47 48 !! 48 #if defined key_diatrc && ! defined key_iomput 49 INTEGER :: jl, jn 50 ! definition of additional diagnostic as a structure 51 TYPE DIAG 52 CHARACTER(len = 20) :: snamedia !: short name 53 CHARACTER(len = 80 ) :: lnamedia !: long name 54 CHARACTER(len = 20 ) :: unitdia !: unit 55 END TYPE DIAG 56 57 TYPE(DIAG) , DIMENSION(jp_pisces_2d) :: pisdia2d 58 TYPE(DIAG) , DIMENSION(jp_pisces_3d) :: pisdia3d 59 #endif 60 49 INTEGER :: jl, jn 50 TYPE(DIAG), DIMENSION(jp_pisces_2d) :: pisdia2d 51 TYPE(DIAG), DIMENSION(jp_pisces_3d) :: pisdia3d 52 !! 61 53 NAMELIST/nampisbio/ part, nrdttrc, wsbio, xkmort, ferat3, wsbio2 62 54 #if defined key_kriest 63 55 NAMELIST/nampiskrp/ xkr_eta, xkr_zeta, xkr_mass_min, xkr_mass_max 64 56 #endif 65 #if defined key_diatrc && ! defined key_iomput 66 NAMELIST/nampisdia/ nn_writedia, pisdia3d, pisdia2d ! additional diagnostics 67 #endif 57 NAMELIST/nampisdia/ pisdia3d, pisdia2d ! additional diagnostics 68 58 NAMELIST/nampisdmp/ ln_pisdmp, ln_pisclo 69 59 … … 77 67 ! ! Open the namelist file 78 68 ! ! ---------------------- 79 CALL ctl_opn( numnat , 'namelist_pisces', 'OLD', 'FORMATTED', 'SEQUENTIAL', -1, numout, .FALSE. )69 CALL ctl_opn( numnatp, 'namelist_pisces', 'OLD', 'FORMATTED', 'SEQUENTIAL', -1, numout, .FALSE. ) 80 70 81 REWIND( numnat )82 READ ( numnat , nampisbio )71 REWIND( numnatp ) 72 READ ( numnatp, nampisbio ) 83 73 84 74 IF(lwp) THEN ! control print … … 101 91 xkr_mass_max = 1. 102 92 103 REWIND( numnat ) ! read natkriest104 READ ( numnat , nampiskrp )93 REWIND( numnatp ) ! read natkriest 94 READ ( numnatp, nampiskrp ) 105 95 106 96 IF(lwp) THEN … … 120 110 #endif 121 111 ! 122 #if defined key_diatrc && ! defined key_iomput 112 IF( .NOT.lk_iomput .AND. ln_diatrc ) THEN 113 ! 114 ! Namelist nampisdia 115 ! ------------------- 116 DO jl = 1, jp_pisces_2d 117 WRITE(pisdia2d(jl)%sname,'("2D_",I1)') jl ! short name 118 WRITE(pisdia2d(jl)%lname,'("2D DIAGNOSTIC NUMBER ",I2)') jl ! long name 119 pisdia2d(jl)%units = ' ' ! units 120 END DO 121 ! ! 3D output arrays 122 DO jl = 1, jp_pisces_3d 123 WRITE(pisdia3d(jl)%sname,'("3D_",I1)') jl ! short name 124 WRITE(pisdia3d(jl)%lname,'("3D DIAGNOSTIC NUMBER ",I2)') jl ! long name 125 pisdia3d(jl)%units = ' ' ! units 126 END DO 123 127 124 ! Namelist namlobdia 125 ! ------------------- 126 nn_writedia = 10 ! default values 127 128 DO jl = 1, jp_pisces_2d 129 jn = jp_pcs0_2d + jl - 1 130 WRITE(ctrc2d(jn),'("2D_",I1)') jn ! short name 131 WRITE(ctrc2l(jn),'("2D DIAGNOSTIC NUMBER ",I2)') jn ! long name 132 ctrc2u(jn) = ' ' ! units 133 END DO 134 ! ! 3D output arrays 135 DO jl = 1, jp_pisces_3d 136 jn = jp_pcs0_3d + jl - 1 137 WRITE(ctrc3d(jn),'("3D_",I1)') jn ! short name 138 WRITE(ctrc3l(jn),'("3D DIAGNOSTIC NUMBER ",I2)') jn ! long name 139 ctrc3u(jn) = ' ' ! units 140 END DO 141 142 REWIND( numnat ) ! read natrtd 143 READ ( numnat, nampisdia ) 144 145 DO jl = 1, jp_pisces_2d 146 jn = jp_pcs0_2d + jl - 1 147 ctrc2d(jn) = pisdia2d(jl)%snamedia 148 ctrc2l(jn) = pisdia2d(jl)%lnamedia 149 ctrc2u(jn) = pisdia2d(jl)%unitdia 150 END DO 151 152 DO jl = 1, jp_pisces_3d 153 jn = jp_pcs0_3d + jl - 1 154 ctrc3d(jn) = pisdia3d(jl)%snamedia 155 ctrc3l(jn) = pisdia3d(jl)%lnamedia 156 ctrc3u(jn) = pisdia3d(jl)%unitdia 157 END DO 158 159 IF(lwp) THEN ! control print 160 WRITE(numout,*) 161 WRITE(numout,*) ' Namelist : natadd' 162 WRITE(numout,*) ' frequency of outputs for additional arrays nn_writedia = ', nn_writedia 163 DO jl = 1, jp_pisces_3d 164 jn = jp_pcs0_3d + jl - 1 165 WRITE(numout,*) ' 3d output field No : ',jn 166 WRITE(numout,*) ' short name : ', TRIM(ctrc3d(jn)) 167 WRITE(numout,*) ' long name : ', TRIM(ctrc3l(jn)) 168 WRITE(numout,*) ' unit : ', TRIM(ctrc3u(jn)) 169 WRITE(numout,*) ' ' 170 END DO 128 REWIND( numnatp ) ! 129 READ ( numnatp, nampisdia ) 171 130 172 131 DO jl = 1, jp_pisces_2d 173 132 jn = jp_pcs0_2d + jl - 1 174 WRITE(numout,*) ' 2d output field No : ',jn 175 WRITE(numout,*) ' short name : ', TRIM(ctrc2d(jn)) 176 WRITE(numout,*) ' long name : ', TRIM(ctrc2l(jn)) 177 WRITE(numout,*) ' unit : ', TRIM(ctrc2u(jn)) 133 ctrc2d(jn) = pisdia2d(jl)%sname 134 ctrc2l(jn) = pisdia2d(jl)%lname 135 ctrc2u(jn) = pisdia2d(jl)%units 136 END DO 137 138 DO jl = 1, jp_pisces_3d 139 jn = jp_pcs0_3d + jl - 1 140 ctrc3d(jn) = pisdia3d(jl)%sname 141 ctrc3l(jn) = pisdia3d(jl)%lname 142 ctrc3u(jn) = pisdia3d(jl)%units 143 END DO 144 145 IF(lwp) THEN ! control print 146 WRITE(numout,*) 147 WRITE(numout,*) ' Namelist : natadd' 148 DO jl = 1, jp_pisces_3d 149 jn = jp_pcs0_3d + jl - 1 150 WRITE(numout,*) ' 3d diag nb : ', jn, ' short name : ', ctrc3d(jn), & 151 & ' long name : ', ctrc3l(jn), ' unit : ', ctrc3u(jn) 152 END DO 178 153 WRITE(numout,*) ' ' 179 END DO 154 155 DO jl = 1, jp_pisces_2d 156 jn = jp_pcs0_2d + jl - 1 157 WRITE(numout,*) ' 2d diag nb : ', jn, ' short name : ', ctrc2d(jn), & 158 & ' long name : ', ctrc2l(jn), ' unit : ', ctrc2u(jn) 159 END DO 160 WRITE(numout,*) ' ' 161 ENDIF 162 ! 180 163 ENDIF 181 #endif182 164 183 REWIND( numnat )184 READ ( numnat , nampisdmp )165 REWIND( numnatp ) 166 READ ( numnatp, nampisdmp ) 185 167 186 168 IF(lwp) THEN ! control print -
branches/2011/dev_r2787_LOCEAN3_TRA_TRP/NEMOGCM/NEMO/TOP_SRC/PISCES/trcrst_pisces.F90
r2715 r2819 43 43 44 44 ! 45 IF( l k_dtatrc.AND. ln_pisclo ) CALL pis_dmp_clo ! restoring of nutrients on close seas45 IF( ln_trcdta .AND. ln_pisclo ) CALL pis_dmp_clo ! restoring of nutrients on close seas 46 46 IF( ln_pisdmp ) CALL pis_dmp_ini ! relaxation of some tracers 47 47 ! … … 53 53 CALL iom_get( knum, jpdom_autoglo, 'PH' , hi(:,:,:) ) 54 54 ELSE 55 hi(:,:,:) = 1.e-9 55 56 ! Set PH from total alkalinity, borat (???), akb3 (???) and ak23 (???) 56 57 ! -------------------------------------------------------- 57 DO jk = 1, jpk58 DO jj = 1, jpj59 DO ji = 1, jpi60 ztmas = tmask(ji,jj,jk)61 ztmas1 = 1. - tmask(ji,jj,jk)62 zcaralk = trn(ji,jj,jk,jptal) - borat(ji,jj,jk) / ( 1. + 1.E-8 / ( rtrn + akb3(ji,jj,jk) ) )63 zco3 = ( zcaralk - trn(ji,jj,jk,jpdic) ) * ztmas + 0.5e-3 * ztmas164 zbicarb = ( 2. * trn(ji,jj,jk,jpdic) - zcaralk )65 66 END DO67 END DO68 END DO58 ! DO jk = 1, jpk 59 ! DO jj = 1, jpj 60 ! DO ji = 1, jpi 61 ! ztmas = tmask(ji,jj,jk) 62 ! ztmas1 = 1. - tmask(ji,jj,jk) 63 ! zcaralk = trn(ji,jj,jk,jptal) - borat(ji,jj,jk) / ( 1. + 1.E-8 / ( rtrn + akb3(ji,jj,jk) ) ) 64 ! zco3 = ( zcaralk - trn(ji,jj,jk,jpdic) ) * ztmas + 0.5e-3 * ztmas1 65 ! zbicarb = ( 2. * trn(ji,jj,jk,jpdic) - zcaralk ) 66 ! hi(ji,jj,jk) = ( ak23(ji,jj,jk) * zbicarb / zco3 ) * ztmas + 1.e-9 * ztmas1 67 ! END DO 68 ! END DO 69 ! END DO 69 70 ENDIF 70 71 CALL iom_get( knum, jpdom_autoglo, 'Silicalim', xksi(:,:) ) … … 120 121 121 122 zarea = 1. / areatot * 1.e6 122 # if defined key_degrad 123 zalksum = glob_sum( trn(:,:,:,jptal) * cvol(:,:,:) * facvol(:,:,:) ) * zarea124 zpo4sum = glob_sum( trn(:,:,:,jppo4) * cvol(:,:,:) * facvol(:,:,:) ) * zarea / 122.125 zno3sum = glob_sum( trn(:,:,:,jpno3) * cvol(:,:,:) * facvol(:,:,:) ) * zarea / 7.6126 zsilsum = glob_sum( trn(:,:,:,jpsil) * cvol(:,:,:) * facvol(:,:,:) ) * zarea127 # else 128 zalksum = glob_sum( trn(:,:,:,jptal) * cvol(:,:,:) ) * zarea129 zpo4sum = glob_sum( trn(:,:,:,jppo4) * cvol(:,:,:) ) * zarea / 122.130 zno3sum = glob_sum( trn(:,:,:,jpno3) * cvol(:,:,:) ) * zarea / 7.6131 zsilsum = glob_sum( trn(:,:,:,jpsil) * cvol(:,:,:) ) * zarea132 # endif 123 IF( lk_degrad ) THEN 124 zalksum = glob_sum( trn(:,:,:,jptal) * cvol(:,:,:) * facvol(:,:,:) ) * zarea 125 zpo4sum = glob_sum( trn(:,:,:,jppo4) * cvol(:,:,:) * facvol(:,:,:) ) * zarea / 122. 126 zno3sum = glob_sum( trn(:,:,:,jpno3) * cvol(:,:,:) * facvol(:,:,:) ) * zarea / 7.6 127 zsilsum = glob_sum( trn(:,:,:,jpsil) * cvol(:,:,:) * facvol(:,:,:) ) * zarea 128 ELSE 129 zalksum = glob_sum( trn(:,:,:,jptal) * cvol(:,:,:) ) * zarea 130 zpo4sum = glob_sum( trn(:,:,:,jppo4) * cvol(:,:,:) ) * zarea / 122. 131 zno3sum = glob_sum( trn(:,:,:,jpno3) * cvol(:,:,:) ) * zarea / 7.6 132 zsilsum = glob_sum( trn(:,:,:,jpsil) * cvol(:,:,:) ) * zarea 133 ENDIF 133 134 134 135 IF(lwp) WRITE(numout,*) ' TALK mean : ', zalksum … … 168 169 !! ictsi2(), ictsj2() : north-east Closed sea limits (i,j) 169 170 !!---------------------------------------------------------------------- 170 INTEGER, PARAMETER :: npicts = 4 !: number of closed sea 171 INTEGER, DIMENSION(npicts) :: ictsi1, ictsj1 !: south-west closed sea limits (i,j) 172 INTEGER, DIMENSION(npicts) :: ictsi2, ictsj2 !: north-east closed sea limits (i,j) 173 INTEGER :: ji, jj, jk, jn, jc ! dummy loop indices 171 INTEGER, PARAMETER :: npicts = 4 ! number of closed sea 172 INTEGER, DIMENSION(npicts) :: ictsi1, ictsj1 ! south-west closed sea limits (i,j) 173 INTEGER, DIMENSION(npicts) :: ictsi2, ictsj2 ! north-east closed sea limits (i,j) 174 INTEGER :: ji, jj, jk, jn, jl, jc ! dummy loop indices 175 INTEGER :: ierr ! local integer 176 REAL(wp), ALLOCATABLE, DIMENSION(:,:,:,:) :: ztrcdta ! 4D workspace 174 177 !!---------------------------------------------------------------------- 175 178 … … 243 246 END DO 244 247 245 #if defined key_dtatrc246 248 ! Restore close seas values to initial data 247 CALL trc_dta( nit000 ) 248 DO jn = 1, jptra 249 IF( lutini(jn) ) THEN 250 DO jc = 1, npicts 251 DO jk = 1, jpkm1 252 DO jj = ictsj1(jc), ictsj2(jc) 253 DO ji = ictsi1(jc), ictsi2(jc) 254 trn(ji,jj,jk,jn) = trdta(ji,jj,jk,jn) * tmask(ji,jj,jk) 255 trb(ji,jj,jk,jn) = trn(ji,jj,jk,jn) 256 ENDDO 257 ENDDO 258 ENDDO 259 ENDDO 260 ENDIF 261 ENDDO 262 #endif 263 ! 249 IF( nb_trcdta > 0 ) THEN ! Initialisation of tracer from a file that may also be used for damping 250 ALLOCATE( ztrcdta(jpi,jpj,jpk,nb_trcdta), STAT=ierr ) 251 IF( ierr > 0 ) THEN 252 CALL ctl_stop( 'trc_ini: unable to allocate ztrcdta array' ) ; RETURN 253 ENDIF 254 ! 255 CALL trc_dta( nit000, ztrcdta ) ! read tracer data at nit000 256 ! 257 DO jn = 1, jptra 258 IF( ln_trc_ini(jn) ) THEN ! update passive tracers arrays with input data read from file 259 jl = n_trc_index(jn) 260 DO jc = 1, npicts 261 DO jk = 1, jpkm1 262 DO jj = ictsj1(jc), ictsj2(jc) 263 DO ji = ictsi1(jc), ictsi2(jc) 264 trn(ji,jj,jk,jn) = ztrcdta(ji,jj,jk,jl) * tmask(ji,jj,jk) 265 trb(ji,jj,jk,jn) = trn(ji,jj,jk,jn) 266 ENDDO 267 ENDDO 268 ENDDO 269 ENDDO 270 ENDIF 271 ENDDO 272 DEALLOCATE( ztrcdta ) 273 ENDIF 274 ! 264 275 END SUBROUTINE pis_dmp_clo 265 276 -
branches/2011/dev_r2787_LOCEAN3_TRA_TRP/NEMOGCM/NEMO/TOP_SRC/PISCES/trcsms_pisces.F90
r2715 r2819 13 13 !! trcsms_pisces : Time loop of passive tracers sms 14 14 !!---------------------------------------------------------------------- 15 USE oce_trc ! 16 USE trc 17 USE sms_pisces 18 19 USE p4zint ! 20 USE p4zche ! 21 USE p4zbio ! 22 USE p4zsink ! 23 USE p4zopt ! 24 USE p4zlim ! 25 USE p4zprod ! 26 USE p4zmort ! 27 USE p4zmicro ! 28 USE p4zmeso ! 29 USE p4zrem ! 30 USE p4zsed ! 31 USE p4zlys ! 32 USE p4zflx ! 33 34 USE prtctl_trc 35 36 USE trdmod_oce 37 USE trdmod_trc 38 39 USE sedmodel 15 USE oce_trc ! shared variables between ocean and passive tracers 16 USE trc ! passive tracers common variables 17 USE sms_pisces ! PISCES Source Minus Sink variables 18 USE p4zbio ! Biological model 19 USE p4zche ! Chemical model 20 USE p4zsink ! vertical flux of particulate matter due to sinking 21 USE p4zopt ! optical model 22 USE p4zlim ! Co-limitations of differents nutrients 23 USE p4zprod ! Growth rate of the 2 phyto groups 24 USE p4zmort ! Mortality terms for phytoplankton 25 USE p4zmicro ! Sources and sinks of microzooplankton 26 USE p4zmeso ! Sources and sinks of mesozooplankton 27 USE p4zrem ! Remineralisation of organic matter 28 USE p4zlys ! Calcite saturation 29 USE p4zflx ! Gas exchange 30 USE p4zsed ! Sedimentation 31 USE p4zint ! time interpolation 32 USE trdmod_oce ! Ocean trends variables 33 USE trdmod_trc ! TOP trends variables 34 USE sedmodel ! Sediment model 35 USE prtctl_trc ! print control for debugging 40 36 41 37 IMPLICIT NONE … … 64 60 !!--------------------------------------------------------------------- 65 61 USE wrk_nemo, ONLY: wrk_in_use, wrk_not_released 66 USE wrk_nemo, ONLY: ztrpis => wrk_3d_1 ! used for pisces sms trends67 62 ! 68 63 INTEGER, INTENT( in ) :: kt ! ocean time-step index … … 74 69 IF( kt == nit000 ) CALL trc_sms_pisces_init ! Initialization (first time-step only) 75 70 76 IF( wrk_in_use(3,1) ) THEN77 CALL ctl_stop('trc_sms_pisces : requested workspace array unavailable.') ; RETURN78 ENDIF79 80 71 IF( ndayflxtr /= nday_year ) THEN ! New days 81 72 ! … … 86 77 IF(lwp) write(numout,*) '~~~~~~' 87 78 88 CALL p4z_che ! computation of chemical constants89 CALL p4z_int ! computation of various rates for biogeochemistry79 CALL p4z_che ! computation of chemical constants 80 CALL p4z_int ! computation of various rates for biogeochemistry 90 81 ! 91 82 ENDIF … … 112 103 IF( l_trdtrc ) THEN 113 104 DO jn = jp_pcs0, jp_pcs1 114 ztrpis(:,:,:) = tra(:,:,:,jn) 115 CALL trd_mod_trc( ztrpis, jn, jptra_trd_sms, kt ) ! save trends 105 CALL trd_mod_trc( tra(:,:,:,jn), jn, jptra_trd_sms, kt ) ! save trends 116 106 END DO 117 DEALLOCATE( ztrpis )118 107 END IF 119 108 … … 127 116 ! 128 117 ENDIF 129 130 IF( wrk_not_released(3,1) ) CALL ctl_stop('trc_sms_pisces : failed to release workspace array.') 131 118 ! 132 119 END SUBROUTINE trc_sms_pisces 133 120 … … 164 151 xstep = rfact2 / rday 165 152 166 CALL p4z_sink_init ! vertical flux of particulate organic matter167 CALL p4z_opt_init ! Optic: PAR in the water column168 CALL p4z_lim_init ! co-limitations by the various nutrients169 CALL p4z_prod_init ! phytoplankton growth rate over the global ocean.170 CALL p4z_rem_init ! remineralisation171 CALL p4z_mort_init ! phytoplankton mortality172 CALL p4z_micro_init ! microzooplankton173 CALL p4z_meso_init ! mesozooplankton174 CALL p4z_sed_init ! sedimentation175 CALL p4z_lys_init ! calcite saturation176 CALL p4z_flx_init ! gas exchange153 CALL p4z_sink_init ! vertical flux of particulate organic matter 154 CALL p4z_opt_init ! Optic: PAR in the water column 155 CALL p4z_lim_init ! co-limitations by the various nutrients 156 CALL p4z_prod_init ! phytoplankton growth rate over the global ocean. 157 CALL p4z_rem_init ! remineralisation 158 CALL p4z_mort_init ! phytoplankton mortality 159 CALL p4z_micro_init ! microzooplankton 160 CALL p4z_meso_init ! mesozooplankton 161 CALL p4z_sed_init ! sedimentation 162 CALL p4z_lys_init ! calcite saturation 163 CALL p4z_flx_init ! gas exchange 177 164 178 165 ndayflxtr = 0 -
branches/2011/dev_r2787_LOCEAN3_TRA_TRP/NEMOGCM/NEMO/TOP_SRC/TRP/trcldf.F90
r2715 r2819 18 18 USE trc ! ocean passive tracers variables 19 19 USE trcnam_trp ! passive tracers transport namelist variables 20 USE ldftra_oce ! lateral diffusion coefficient on tracers21 20 USE ldfslp ! ??? 22 21 USE traldf_bilapg ! lateral mixing (tra_ldf_bilapg routine) … … 33 32 PUBLIC trc_ldf ! called by step.F90 34 33 ! !!: ** lateral mixing namelist (nam_trcldf) ** 35 INTEGER :: nldf = 0 ! type of lateral diffusion used defined from ln_trcldf_... namlist logicals) 34 REAL(wp) :: rldf_rat ! ratio between active and passive tracers diffusive coefficient 35 INTEGER :: nldf = 0 ! type of lateral diffusion used defined from ln_trcldf_... namlist logicals) 36 36 !! * Substitutions 37 37 # include "domzgr_substitute.h90" … … 61 61 IF( kt == nit000 ) CALL ldf_ctl ! initialisation & control of options 62 62 63 rldf = rldf_rat 64 63 65 IF( l_trdtrc ) THEN 64 66 ALLOCATE( ztrtrd(jpi,jpj,jpk,jptra) ) ! temporary save of trends … … 67 69 68 70 SELECT CASE ( nldf ) ! compute lateral mixing trend and add it to the general trend 69 CASE ( 0 ) ; CALL tra_ldf_lap ( kt, 'TRC', gtru, gtrv, trb, tra, jptra ) ! iso-level laplacian70 CASE ( 1 ) ; CALL tra_ldf_iso ( kt, 'TRC', gtru, gtrv, trb, tra, jptra, rn_aht b_0 ) ! rotated laplacian71 CASE ( 2 ) ; CALL tra_ldf_bilap ( kt, 'TRC', gtru, gtrv, trb, tra, jptra ) ! iso-level bilaplacian72 CASE ( 3 ) ; CALL tra_ldf_bilapg( kt, 'TRC', trb, tra, jptra ) ! s-coord. horizontal bilaplacian71 CASE ( 0 ) ; CALL tra_ldf_lap ( kt, 'TRC', gtru, gtrv, trb, tra, jptra ) ! iso-level laplacian 72 CASE ( 1 ) ; CALL tra_ldf_iso ( kt, 'TRC', gtru, gtrv, trb, tra, jptra, rn_ahtrb_0 ) ! rotated laplacian 73 CASE ( 2 ) ; CALL tra_ldf_bilap ( kt, 'TRC', gtru, gtrv, trb, tra, jptra ) ! iso-level bilaplacian 74 CASE ( 3 ) ; CALL tra_ldf_bilapg( kt, 'TRC', trb, tra, jptra ) ! s-coord. horizontal bilaplacian 73 75 ! 74 76 CASE ( -1 ) ! esopa: test all possibility with control print 75 CALL tra_ldf_lap ( kt, 'TRC', gtru, gtrv, trb, tra, jptra )77 CALL tra_ldf_lap ( kt, 'TRC', gtru, gtrv, trb, tra, jptra ) 76 78 WRITE(charout, FMT="('ldf0 ')") ; CALL prt_ctl_trc_info(charout) 77 79 CALL prt_ctl_trc( tab4d=tra, mask=tmask, clinfo=ctrcnm, clinfo2='trd' ) 78 CALL tra_ldf_iso ( kt, 'TRC', gtru, gtrv, trb, tra, jptra, rn_aht b_0 )80 CALL tra_ldf_iso ( kt, 'TRC', gtru, gtrv, trb, tra, jptra, rn_ahtrb_0 ) 79 81 WRITE(charout, FMT="('ldf1 ')") ; CALL prt_ctl_trc_info(charout) 80 82 CALL prt_ctl_trc( tab4d=tra, mask=tmask, clinfo=ctrcnm, clinfo2='trd' ) 81 CALL tra_ldf_bilap ( kt, 'TRC', gtru, gtrv, trb, tra, jptra )83 CALL tra_ldf_bilap ( kt, 'TRC', gtru, gtrv, trb, tra, jptra ) 82 84 WRITE(charout, FMT="('ldf2 ')") ; CALL prt_ctl_trc_info(charout) 83 85 CALL prt_ctl_trc( tab4d=tra, mask=tmask, clinfo=ctrcnm, clinfo2='trd' ) 84 CALL tra_ldf_bilapg( kt, 'TRC', trb, tra, jptra )86 CALL tra_ldf_bilapg( kt, 'TRC', trb, tra, jptra ) 85 87 WRITE(charout, FMT="('ldf3 ')") ; CALL prt_ctl_trc_info(charout) 86 88 CALL prt_ctl_trc( tab4d=tra, mask=tmask, clinfo=ctrcnm, clinfo2='trd' ) … … 119 121 INTEGER :: ioptio, ierr ! temporary integers 120 122 !!---------------------------------------------------------------------- 123 124 rldf_rat = rn_ahtrc_0 / rn_aht_0 121 125 122 126 ! Define the lateral mixing oparator for tracers … … 206 210 ENDIF 207 211 212 IF( ln_trcldf_bilap ) THEN 213 IF(lwp) WRITE(numout,*) ' biharmonic tracer diffusion' 214 IF( rn_ahtrc_0 > 0 .AND. .NOT. lk_esopa ) CALL ctl_stop( 'The horizontal diffusivity coef. rn_ahtrc_0 must be negative' ) 215 ELSE 216 IF(lwp) WRITE(numout,*) ' harmonic tracer diffusion (default)' 217 IF( rn_ahtrc_0 < 0 .AND. .NOT. lk_esopa ) CALL ctl_stop('The horizontal diffusivity coef. rn_ahtrc_0 must be positive' ) 218 ENDIF 219 220 ! ratio between active and passive tracers diffusive coef. 221 rldf_rat = rn_ahtrc_0 / rn_aht_0 222 IF( rldf_rat < 0 ) THEN 223 IF( .NOT.lk_offline ) THEN 224 CALL ctl_stop( 'Choose the same type of diffusive scheme both for active & passive tracers' ) 225 ELSE 226 CALL ctl_stop( 'Change the sign of rn_aht_0 in namelist to -/+1' ) 227 ENDIF 228 ENDIF 208 229 ! 209 230 END SUBROUTINE ldf_ctl -
branches/2011/dev_r2787_LOCEAN3_TRA_TRP/NEMOGCM/NEMO/TOP_SRC/TRP/trcnam_trp.F90
r2528 r2819 36 36 LOGICAL , PUBLIC :: ln_trcldf_hor = .FALSE. !: horizontal (geopotential) direction 37 37 LOGICAL , PUBLIC :: ln_trcldf_iso = .TRUE. !: iso-neutral direction 38 REAL(wp), PUBLIC :: rn_ahtrc_0 !: diffusivity coefficient for passive tracer (m2/s) 38 39 REAL(wp), PUBLIC :: rn_ahtrb_0 !: background diffusivity coefficient for passive tracer (m2/s) 39 40 … … 76 77 NAMELIST/namtrc_ldf/ ln_trcldf_diff , ln_trcldf_lap , & 77 78 & ln_trcldf_bilap, ln_trcldf_level, & 78 & ln_trcldf_hor , ln_trcldf_iso , rn_ahtr b_079 & ln_trcldf_hor , ln_trcldf_iso , rn_ahtrc_0, rn_ahtrb_0 79 80 NAMELIST/namtrc_zdf/ ln_trczdf_exp , nn_trczdf_exp 80 81 NAMELIST/namtrc_rad/ ln_trcrad … … 119 120 WRITE(numout,*) ' horizontal (geopotential) ln_trcldf_hor = ', ln_trcldf_hor 120 121 WRITE(numout,*) ' iso-neutral ln_trcldf_iso = ', ln_trcldf_iso 122 WRITE(numout,*) ' diffusivity coefficient rn_ahtrc_0 = ', rn_ahtrc_0 121 123 WRITE(numout,*) ' background hor. diffusivity rn_ahtrb_0 = ', rn_ahtrb_0 122 124 ENDIF -
branches/2011/dev_r2787_LOCEAN3_TRA_TRP/NEMOGCM/NEMO/TOP_SRC/oce_trc.F90
r2789 r2819 196 196 USE oce , ONLY : gru => gru !: 197 197 USE oce , ONLY : grv => grv !: 198 # if defined key_degrad199 USE dommsk , ONLY : facvol => facvol !: volume factor for degradation200 # endif201 202 198 #endif 203 199 … … 224 220 225 221 !* lateral diffusivity (tracers) * 226 USE ldftra_oce , ONLY : aht0 => aht0 !: horizontal eddy diffusivity for tracers (m2/s) 227 USE ldftra_oce , ONLY : ahtb0 => ahtb0 !: background eddy diffusivity for isopycnal diff. (m2/s) 228 USE ldftra_oce , ONLY : ahtu => ahtu !: lateral diffusivity coef. at u-points 229 USE ldftra_oce , ONLY : ahtv => ahtv !: lateral diffusivity coef. at v-points 230 USE ldftra_oce , ONLY : ahtw => ahtw !: lateral diffusivity coef. at w-points 231 USE ldftra_oce , ONLY : ahtt => ahtt !: lateral diffusivity coef. at t-points 232 USE ldftra_oce , ONLY : aeiv0 => aeiv0 !: eddy induced velocity coefficient (m2/s) 233 USE ldftra_oce , ONLY : aeiu => aeiu !: eddy induced velocity coef. at u-points (m2/s) 234 USE ldftra_oce , ONLY : aeiv => aeiv !: eddy induced velocity coef. at v-points (m2/s) 235 USE ldftra_oce , ONLY : aeiw => aeiw !: eddy induced velocity coef. at w-points (m2/s) 222 USE ldftra_oce , ONLY : rldf => rldf !: multiplicative coef. for lateral diffusivity 223 USE ldftra_oce , ONLY : rn_aht_0 => rn_aht_0 !: horizontal eddy diffusivity for tracers (m2/s) 224 USE ldftra_oce , ONLY : aht0 => aht0 !: horizontal eddy diffusivity for tracers (m2/s) 225 USE ldftra_oce , ONLY : ahtb0 => ahtb0 !: background eddy diffusivity for isopycnal diff. (m2/s) 226 USE ldftra_oce , ONLY : ahtu => ahtu !: lateral diffusivity coef. at u-points 227 USE ldftra_oce , ONLY : ahtv => ahtv !: lateral diffusivity coef. at v-points 228 USE ldftra_oce , ONLY : ahtw => ahtw !: lateral diffusivity coef. at w-points 229 USE ldftra_oce , ONLY : ahtt => ahtt !: lateral diffusivity coef. at t-points 230 USE ldftra_oce , ONLY : aeiv0 => aeiv0 !: eddy induced velocity coefficient (m2/s) 231 USE ldftra_oce , ONLY : aeiu => aeiu !: eddy induced velocity coef. at u-points (m2/s) 232 USE ldftra_oce , ONLY : aeiv => aeiv !: eddy induced velocity coef. at v-points (m2/s) 233 USE ldftra_oce , ONLY : aeiw => aeiw !: eddy induced velocity coef. at w-points (m2/s) 234 USE ldftra_oce , ONLY : lk_traldf_eiv => lk_traldf_eiv !: eddy induced velocity flag 236 235 237 236 !* vertical diffusion * 238 237 USE zdf_oce , ONLY : avt => avt !: vert. diffusivity coef. at w-point for temp 239 238 # if defined key_zdfddm 240 USE zdfddm , ONLY : avs => avs !: salinity vertical diffusivity coeff. at w-point239 USE zdfddm , ONLY : avs => avs !: salinity vertical diffusivity coeff. at w-point 241 240 # endif 242 241 -
branches/2011/dev_r2787_LOCEAN3_TRA_TRP/NEMOGCM/NEMO/TOP_SRC/trc.F90
r2715 r2819 21 21 PUBLIC trc_alloc ! called by nemogcm.F90 22 22 23 !! passive tracers names and units (read in namelist)24 !! --------------------------------------------------25 CHARACTER(len=12), PUBLIC, DIMENSION(jptra) :: ctrcnm !: tracer name26 CHARACTER(len=12), PUBLIC, DIMENSION(jptra) :: ctrcun !: tracer unit27 CHARACTER(len=80), PUBLIC, DIMENSION(jptra) :: ctrcnl !: tracer long name28 29 30 23 !! parameters for the control of passive tracers 31 24 !! -------------------------------------------------- 32 INTEGER, PUBLIC :: numnat !: the number of the passive tracer NAMELIST 33 LOGICAL, PUBLIC, DIMENSION(jptra) :: lutini !: initialisation from FILE or not (NAMELIST) 34 LOGICAL, PUBLIC, DIMENSION(jptra) :: lutsav !: save the tracer or not 25 INTEGER, PUBLIC :: numnat !: the number of the passive tracer NAMELIST 35 26 36 27 !! passive tracers fields (before,now,after) 37 28 !! -------------------------------------------------- 38 REAL(wp), PUBLIC :: trai!: initial total tracer39 REAL(wp), PUBLIC :: areatot!: total volume40 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION (:,:,:) :: cvol!: volume correction -degrad option-41 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION (:,:,:,:) :: trn!: traceur concentration for now time step42 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION (:,:,:,:) :: tra!: traceur concentration for next time step43 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION (:,:,:,:) :: trb!: traceur concentration for before time step29 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:) :: trai !: initial total tracer 30 REAL(wp), PUBLIC :: areatot !: total volume 31 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,: ) :: cvol !: volume correction -degrad option- 32 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:,:) :: trn !: traceur concentration for now time step 33 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:,:) :: tra !: traceur concentration for next time step 34 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:,:) :: trb !: traceur concentration for before time step 44 35 45 36 !! interpolated gradient 46 37 !!-------------------------------------------------- 47 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION (:,:,:) :: gtru!: hor. gradient at u-points at bottom ocean level48 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION (:,:,:) :: gtrv!: hor. gradient at v-points at bottom ocean level38 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: gtru !: hor. gradient at u-points at bottom ocean level 39 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: gtrv !: hor. gradient at v-points at bottom ocean level 49 40 50 !! passive tracers restart(input and output)41 !! passive tracers (input and output) 51 42 !! ------------------------------------------ 52 LOGICAL , PUBLIC :: ln_rsttr !: boolean term for restart i/o for passive tracers (namelist) 53 LOGICAL , PUBLIC :: lrst_trc !: logical to control the trc restart write 54 INTEGER , PUBLIC :: nn_dttrc !: frequency of step on passive tracers 55 INTEGER , PUBLIC :: nutwrs !: output FILE for passive tracers restart 56 INTEGER , PUBLIC :: nutrst !: logical unit for restart FILE for passive tracers 57 INTEGER , PUBLIC :: nn_rsttr !: control of the time step ( 0 or 1 ) for pass. tr. 58 CHARACTER(len=50), PUBLIC :: cn_trcrst_in !: suffix of pass. tracer restart name (input) 59 CHARACTER(len=50), PUBLIC :: cn_trcrst_out !: suffix of pass. tracer restart name (output) 60 43 LOGICAL , PUBLIC :: ln_rsttr !: boolean term for restart i/o for passive tracers (namelist) 44 LOGICAL , PUBLIC :: lrst_trc !: logical to control the trc restart write 45 INTEGER , PUBLIC :: nn_dttrc !: frequency of step on passive tracers 46 INTEGER , PUBLIC :: nn_writetrc !: time step frequency for concentration outputs (namelist) 47 INTEGER , PUBLIC :: nutwrs !: output FILE for passive tracers restart 48 INTEGER , PUBLIC :: nutrst !: logical unit for restart FILE for passive tracers 49 INTEGER , PUBLIC :: nn_rsttr !: control of the time step ( 0 or 1 ) for pass. tr. 50 CHARACTER(len = 80) , PUBLIC :: cn_trcrst_in !: suffix of pass. tracer restart name (input) 51 CHARACTER(len = 80) , PUBLIC :: cn_trcrst_out !: suffix of pass. tracer restart name (output) 52 REAL(wp) , PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:) :: rdttrc !: vertical profile of passive tracer time step 53 LOGICAL , PUBLIC :: ln_trcdta !: Read inputs data from files 54 LOGICAL , PUBLIC :: ln_trcdmp !: internal damping flag 55 61 56 !! information for outputs 62 57 !! -------------------------------------------------- 63 INTEGER , PUBLIC :: nn_writetrc !: time step frequency for concentration outputs (namelist) 64 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:) :: rdttrc !: vertical profile of passive tracer time step 65 66 # if defined key_diatrc && ! defined key_iomput 58 TYPE, PUBLIC :: PTRACER !: Passive tracer type 59 CHARACTER(len = 20) :: clsname !: short name 60 CHARACTER(len = 80) :: cllname !: long name 61 CHARACTER(len = 20) :: clunit !: unit 62 LOGICAL :: llinit !: read in a file or not 63 LOGICAL :: llsave !: save the tracer or not 64 END TYPE PTRACER 65 CHARACTER(len = 20), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:) :: ctrcnm !: tracer name 66 CHARACTER(len = 80), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:) :: ctrcln !: trccer field long name 67 CHARACTER(len = 20), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:) :: ctrcun !: tracer unit 68 LOGICAL , PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:) :: ln_trc_ini !: Initialisation from data input file 69 LOGICAL , PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:) :: ln_trc_wri !: save the tracer or not 70 71 TYPE, PUBLIC :: DIAG !: passive trcacer ddditional diagnostic type 72 CHARACTER(len = 20) :: sname !: short name 73 CHARACTER(len = 80) :: lname !: long name 74 CHARACTER(len = 20) :: units !: unit 75 END TYPE DIAG 76 67 77 !! additional 2D/3D outputs namelist 68 78 !! -------------------------------------------------- 69 INTEGER , PUBLIC :: nn_writedia !: frequency of additional arrays outputs(namelist) 70 CHARACTER(len= 8), PUBLIC, DIMENSION(jpdia2d) :: ctrc2d !: 2d output field name 71 CHARACTER(len= 8), PUBLIC, DIMENSION(jpdia2d) :: ctrc2u !: 2d output field unit 72 CHARACTER(len= 8), PUBLIC, DIMENSION(jpdia3d) :: ctrc3d !: 3d output field name 73 CHARACTER(len= 8), PUBLIC, DIMENSION(jpdia3d) :: ctrc3u !: 3d output field unit 74 CHARACTER(len=80), PUBLIC, DIMENSION(jpdia2d) :: ctrc2l !: 2d output field long name 75 CHARACTER(len=80), PUBLIC, DIMENSION(jpdia3d) :: ctrc3l !: 3d output field long name 79 REAL(wp) , PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:, :) :: trc2d !: additional 2d outputs array 80 REAL(wp) , PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:,:) :: trc3d !: additional 3d outputs array 81 CHARACTER(len = 20), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:) :: ctrc2d !: 2d field short name 82 CHARACTER(len = 80), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:) :: ctrc2l !: 2d field long name 83 CHARACTER(len = 20), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:) :: ctrc2u !: 2d field unit 84 CHARACTER(len = 20), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:) :: ctrc3d !: 3d field short name 85 CHARACTER(len = 80), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:) :: ctrc3l !: 3d field long name 86 CHARACTER(len = 20), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:) :: ctrc3u !: 3d field unit 87 LOGICAL , PUBLIC :: ln_diatrc !: boolean term for additional diagnostic 88 INTEGER , PUBLIC :: nn_writedia !: frequency of additional outputs 76 89 77 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:, :) :: trc2d !: additional 2d outputs78 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:,:) :: trc3d !: additional 3d outputs79 # endif80 81 # if defined key_diabio || defined key_trdmld_trc82 ! !!* namtop_XXX namelist *83 INTEGER , PUBLIC :: nn_writebio !: time step frequency for biological outputs84 CHARACTER(len=8 ), PUBLIC, DIMENSION(jpdiabio) :: ctrbio !: biological trends name85 CHARACTER(len=20), PUBLIC, DIMENSION(jpdiabio) :: ctrbiu !: biological trends unit86 CHARACTER(len=80), PUBLIC, DIMENSION(jpdiabio) :: ctrbil !: biological trends long name87 # endif88 # if defined key_diabio89 90 !! Biological trends 90 91 !! ----------------- 91 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:,:) :: trbio !: biological trends 92 # endif 93 94 95 !! passive tracers data read and at given time_step 96 !! -------------------------------------------------- 97 # if defined key_dtatrc 98 INTEGER , PUBLIC, DIMENSION(jptra) :: numtr !: logical unit for passive tracers data 99 # endif 92 LOGICAL , PUBLIC :: ln_diabio !: boolean term for biological diagnostic 93 INTEGER , PUBLIC :: nn_writebio !: frequency of biological outputs 94 REAL(wp) , PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:,:) :: trbio !: biological trends 95 CHARACTER(len = 20), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:) :: ctrbio !: bio field short name 96 CHARACTER(len = 80), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:) :: ctrbil !: bio field long name 97 CHARACTER(len = 20), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:) :: ctrbiu !: bio field unit 100 98 101 99 !!---------------------------------------------------------------------- … … 113 111 !!------------------------------------------------------------------- 114 112 ! 115 ALLOCATE( cvol(jpi,jpj,jpk ) , & 116 & trn (jpi,jpj,jpk,jptra) , & 117 & tra (jpi,jpj,jpk,jptra) , & 118 & trb (jpi,jpj,jpk,jptra) , & 119 & gtru(jpi,jpj ,jptra) , gtrv(jpi,jpj,jptra) , & 120 # if defined key_diatrc && ! defined key_iomput 121 & trc2d(jpi,jpj,jpdia2d), trc3d(jpi,jpj,jpk,jpdia3d), & 122 # endif 123 # if defined key_diabio 124 & trbio(jpi,jpj,jpk,jpdiabio), & 125 #endif 126 rdttrc(jpk) , STAT=trc_alloc ) 113 ALLOCATE( trn(jpi,jpj,jpk,jptra), trb(jpi,jpj,jpk,jptra), tra(jpi,jpj,jpk,jptra), & 114 & gtru(jpi,jpj,jpk) , gtrv(jpi,jpj,jpk) , & 115 & cvol(jpi,jpj,jpk) , rdttrc(jpk) , trai(jptra) , & 116 & ctrcnm(jptra) , ctrcln(jptra) , ctrcun(jptra) , & 117 & ln_trc_ini(jptra) , ln_trc_wri(jptra) , STAT = trc_alloc ) 127 118 128 119 IF( trc_alloc /= 0 ) CALL ctl_warn('trc_alloc: failed to allocate arrays') -
branches/2011/dev_r2787_LOCEAN3_TRA_TRP/NEMOGCM/NEMO/TOP_SRC/trcdia.F90
r2715 r2819 11 11 !! ! 2008-05 (C. Ethe re-organization) 12 12 !!---------------------------------------------------------------------- 13 #if defined key_top && ! defined key_iomput13 #if defined key_top 14 14 !!---------------------------------------------------------------------- 15 15 !! 'key_top' TOP models … … 25 25 USE par_trc 26 26 USE dianam ! build name of file (routine) 27 USE ioipsl 27 USE ioipsl ! I/O manager 28 USE iom ! I/O manager 29 USE lib_mpp ! MPP library 28 30 29 31 IMPLICIT NONE … … 31 33 32 34 PUBLIC trc_dia ! called by XXX module 33 PUBLIC trc_dia_alloc ! called by nemogcm.F9034 35 35 36 INTEGER :: nit5 !: id for tracer output file … … 41 42 INTEGER , ALLOCATABLE, SAVE, DIMENSION (:) :: ndext50 !: integer arrays for ocean 3D index 42 43 INTEGER , ALLOCATABLE, SAVE, DIMENSION (:) :: ndext51 !: integer arrays for ocean surface index 43 # if defined key_diatrc 44 44 45 INTEGER :: nitd !: id for additional array output file 45 46 INTEGER :: ndepitd !: id for depth mesh 46 47 INTEGER :: nhoritd !: id for horizontal mesh 47 # endif 48 # if defined key_diabio 48 49 49 INTEGER :: nitb !: id. for additional array output file 50 50 INTEGER :: ndepitb !: id for depth mesh 51 51 INTEGER :: nhoritb !: id for horizontal mesh 52 # endif53 52 54 53 !! * Substitutions … … 67 66 !! ** Purpose : output passive tracers fields 68 67 !!--------------------------------------------------------------------- 69 INTEGER, INTENT(in) :: kt ! ocean time-step70 ! 71 INTEGER ::kindic ! local integer68 INTEGER, INTENT(in) :: kt ! ocean time-step 69 ! 70 INTEGER :: ierr, kindic ! local integer 72 71 !!--------------------------------------------------------------------- 73 72 ! 74 CALL trcdit_wr( kt, kindic ) ! outputs for tracer concentration 75 CALL trcdii_wr( kt, kindic ) ! outputs for additional arrays 76 CALL trcdib_wr( kt, kindic ) ! outputs for biological trends 73 IF( kt == nit000 ) THEN 74 ALLOCATE( ndext50(jpij*jpk), ndext51(jpij), STAT=ierr ) 75 IF( ierr > 0 ) THEN 76 CALL ctl_stop( 'STOP', 'trc_diat: unable to allocate arrays' ) ; RETURN 77 ENDIF 78 ENDIF 79 ! 80 IF( .NOT.lk_iomput ) THEN 81 CALL trcdit_wr( kt, kindic ) ! outputs for tracer concentration 82 IF( ln_diatrc ) CALL trcdii_wr( kt, kindic ) ! outputs for additional arrays 83 IF( ln_diabio ) CALL trcdib_wr( kt, kindic ) ! outputs for biological trends 84 ENDIF 77 85 ! 78 86 END SUBROUTINE trc_dia … … 145 153 146 154 IF( kt == nit000 ) THEN 155 156 IF(lwp) THEN ! control print 157 WRITE(numout,*) 158 WRITE(numout,*) ' frequency of outputs for passive tracers nn_writetrc = ', nn_writetrc 159 DO jn = 1, jptra 160 IF( ln_trc_wri(jn) ) WRITE(numout,*) ' ouput tracer nb : ', jn, ' short name : ', ctrcnm(jn) 161 END DO 162 WRITE(numout,*) ' ' 163 ENDIF 147 164 148 165 ! Compute julian date from starting date of the run … … 182 199 ! Declare all the output fields as NETCDF variables 183 200 DO jn = 1, jptra 184 IF( l utsav(jn) ) THEN201 IF( ln_trc_wri(jn) ) THEN 185 202 cltra = TRIM( ctrcnm(jn) ) ! short title for tracer 186 cltral = TRIM( ctrc nl(jn) ) ! long title for tracer203 cltral = TRIM( ctrcln(jn) ) ! long title for tracer 187 204 cltrau = TRIM( ctrcun(jn) ) ! UNIT for tracer 188 205 CALL histdef( nit5, cltra, cltral, cltrau, jpi, jpj, nhorit5, & … … 209 226 DO jn = 1, jptra 210 227 cltra = TRIM( ctrcnm(jn) ) ! short title for tracer 211 IF( l utsav(jn) ) CALL histwrite( nit5, cltra, it, trn(:,:,:,jn), ndimt50, ndext50 )228 IF( ln_trc_wri(jn) ) CALL histwrite( nit5, cltra, it, trn(:,:,:,jn), ndimt50, ndext50 ) 212 229 END DO 213 230 … … 217 234 ! 218 235 END SUBROUTINE trcdit_wr 219 220 #if defined key_diatrc221 236 222 237 SUBROUTINE trcdii_wr( kt, kindic ) … … 360 375 361 376 END SUBROUTINE trcdii_wr 362 363 # else364 SUBROUTINE trcdii_wr( kt, kindic ) ! Dummy routine365 INTEGER, INTENT (in) :: kt, kindic366 END SUBROUTINE trcdii_wr367 # endif368 369 # if defined key_diabio370 377 371 378 SUBROUTINE trcdib_wr( kt, kindic ) … … 485 492 END SUBROUTINE trcdib_wr 486 493 487 # else488 489 SUBROUTINE trcdib_wr( kt, kindic ) ! Dummy routine490 INTEGER, INTENT ( in ) :: kt, kindic491 END SUBROUTINE trcdib_wr492 493 # endif494 495 INTEGER FUNCTION trc_dia_alloc()496 !!---------------------------------------------------------------------497 !! *** ROUTINE trc_dia_alloc ***498 !!---------------------------------------------------------------------499 ALLOCATE( ndext50(jpij*jpk), ndext51(jpij), STAT=trc_dia_alloc )500 !501 IF( trc_dia_alloc /= 0 ) CALL ctl_warn('trc_dia_alloc : failed to allocate arrays')502 !503 END FUNCTION trc_dia_alloc504 494 #else 505 495 !!---------------------------------------------------------------------- -
branches/2011/dev_r2787_LOCEAN3_TRA_TRP/NEMOGCM/NEMO/TOP_SRC/trcdta.F90
r2715 r2819 7 7 !! - ! 2004-03 (C. Ethe) module 8 8 !! - ! 2005-03 (O. Aumont, A. El Moussaoui) F90 9 !!---------------------------------------------------------------------- 10 #if defined key_top && defined key_dtatrc 11 !!---------------------------------------------------------------------- 12 !! 'key_top' and 'key_dtatrc' TOP model + passive tracer data 13 !!---------------------------------------------------------------------- 14 !! trc_dta : read ocean passive tracer data 15 !!---------------------------------------------------------------------- 16 USE oce_trc 17 USE par_trc 18 USE trc 19 USE lib_print 20 USE iom 9 !! 3.4 ! 2010-11 (C. Ethe, G. Madec) use of fldread + dynamical allocation 10 !!---------------------------------------------------------------------- 11 #if defined key_top 12 !!---------------------------------------------------------------------- 13 !! 'key_top' TOP model 14 !!---------------------------------------------------------------------- 15 !! trc_dta : read and time interpolated passive tracer data 16 !!---------------------------------------------------------------------- 17 USE par_trc ! passive tracers parameters 18 USE oce_trc ! shared variables between ocean and passive tracers 19 USE trc ! passive tracers common variables 20 USE iom ! I/O manager 21 USE lib_mpp ! MPP library 22 USE fldread ! read input fields 21 23 22 24 IMPLICIT NONE … … 24 26 25 27 PUBLIC trc_dta ! called in trcini.F90 and trcdmp.F90 26 PUBLIC trc_dta_alloc ! called in nemogcm.F90 27 28 LOGICAL , PUBLIC, PARAMETER :: lk_dtatrc = .TRUE. !: temperature data flag 29 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:,:) :: trdta !: tracer data at given time-step 30 31 REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:,:,:,:) :: tracdta ! tracer data at two consecutive times 32 INTEGER , ALLOCATABLE, SAVE, DIMENSION(:) :: nlectr !: switch for reading once 33 INTEGER , ALLOCATABLE, SAVE, DIMENSION(:) :: ntrc1 !: number of 1st month when reading 12 monthly value 34 INTEGER , ALLOCATABLE, SAVE, DIMENSION(:) :: ntrc2 !: number of 2nd month when reading 12 monthly value 28 PUBLIC trc_dta_init ! called in trcini.F90 29 30 INTEGER , SAVE, PUBLIC :: nb_trcdta ! number of tracers to be initialised with data 31 INTEGER , SAVE, PUBLIC, ALLOCATABLE, DIMENSION(:) :: n_trc_index ! indice of tracer which is initialised with data 32 INTEGER , SAVE :: ntra ! MAX( 1, nb_trcdta ) to avoid compilation error with bounds checking 33 REAL(wp) , SAVE, ALLOCATABLE, DIMENSION(:) :: rf_trfac ! multiplicative factor for tracer values 34 TYPE(FLD), SAVE, ALLOCATABLE, DIMENSION(:) :: sf_trcdta ! structure of input SST (file informations, fields read) 35 35 36 36 !! * Substitutions 37 # include " top_substitute.h90"38 !!---------------------------------------------------------------------- 39 !! NEMO/ TOP3.3 , NEMO Consortium (2010)37 # include "domzgr_substitute.h90" 38 !!---------------------------------------------------------------------- 39 !! NEMO/OPA 3.3 , NEMO Consortium (2010) 40 40 !! $Id$ 41 41 !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt) … … 43 43 CONTAINS 44 44 45 SUBROUTINE trc_dta( kt ) 45 SUBROUTINE trc_dta_init 46 !!---------------------------------------------------------------------- 47 !! *** ROUTINE trc_dta_init *** 48 !! 49 !! ** Purpose : initialisation of passive tracer input data 50 !! 51 !! ** Method : - Read namtsd namelist 52 !! - allocates passive tracer data structure 53 !!---------------------------------------------------------------------- 54 ! 55 INTEGER :: jl, jn ! dummy loop indicies 56 INTEGER :: ierr0, ierr1, ierr2, ierr3 ! temporary integers 57 CHARACTER(len=100) :: clndta, clntrc 58 REAL(wp) :: zfact 59 ! 60 CHARACTER(len=100) :: cn_dir 61 TYPE(FLD_N), DIMENSION(jptra) :: slf_i ! array of namelist informations on the fields to read 62 TYPE(FLD_N), DIMENSION(jptra) :: sn_trcdta 63 REAL(wp) , DIMENSION(jptra) :: rn_trfac ! multiplicative factor for tracer values 64 !! 65 NAMELIST/namtrc_dta/ sn_trcdta, cn_dir, rn_trfac 66 !!---------------------------------------------------------------------- 67 ! 68 ! Initialisation 69 ierr0 = 0 ; ierr1 = 0 ; ierr2 = 0 ; ierr3 = 0 70 ! Compute the number of tracers to be initialised with data 71 ALLOCATE( n_trc_index(jptra), STAT=ierr0 ) 72 IF( ierr0 > 0 ) THEN 73 CALL ctl_stop( 'trc_nam: unable to allocate n_trc_index' ) ; RETURN 74 ENDIF 75 nb_trcdta = 0 76 n_trc_index(:) = 0 77 DO jn = 1, jptra 78 IF( ln_trc_ini(jn) ) THEN 79 nb_trcdta = nb_trcdta + 1 80 n_trc_index(jn) = nb_trcdta 81 ENDIF 82 ENDDO 83 ! 84 ntra = MAX( 1, nb_trcdta ) ! To avoid compilation error with bounds checking 85 WRITE(numout,*) ' ' 86 WRITE(numout,*) ' number of passive tracers to be initialize by data :', ntra 87 WRITE(numout,*) ' ' 88 ! ! allocate the arrays (if necessary) 89 ! 90 cn_dir = './' ! directory in which the model is executed 91 DO jn = 1, jptra 92 WRITE( clndta,'("TR_",I1)' ) jn 93 clndta = TRIM( clndta ) 94 ! ! file ! frequency ! variable ! time intep ! clim ! 'yearly' or ! weights ! rotation ! 95 ! ! name ! (hours) ! name ! (T/F) ! (T/F) ! 'monthly' ! filename ! pairs ! 96 sn_trcdta(jn) = FLD_N( clndta , -1 , clndta , .false. , .true. , 'monthly' , '' , '' ) 97 ! 98 rn_trfac(jn) = 1._wp 99 END DO 100 ! 101 REWIND( numnat ) ! read nattrc 102 READ ( numnat, namtrc_dta ) 103 104 IF( lwp ) THEN 105 DO jn = 1, jptra 106 IF( ln_trc_ini(jn) ) THEN ! open input file only if ln_trc_ini(jn) is true 107 clndta = TRIM( sn_trcdta(jn)%clvar ) 108 clntrc = TRIM( ctrcnm (jn) ) 109 zfact = rn_trfac(jn) 110 IF( clndta /= clntrc ) THEN 111 CALL ctl_warn( 'trc_dta_init: passive tracer data initialisation : ', & 112 & 'the variable name in the data file : '//clndta// & 113 & ' must be the same than the name of the passive tracer : '//clntrc//' ') 114 ENDIF 115 WRITE(numout,*) ' read an initial file for passive tracer number :', jn, ' name : ', clndta, & 116 & ' multiplicative factor : ', zfact 117 ENDIF 118 END DO 119 ENDIF 120 ! 121 IF( nb_trcdta > 0 ) THEN ! allocate only if the number of tracer to initialise is greater than zero 122 ALLOCATE( sf_trcdta(nb_trcdta), rf_trfac(nb_trcdta), STAT=ierr1 ) 123 IF( ierr1 > 0 ) THEN 124 CALL ctl_stop( 'trc_dta_ini: unable to allocate sf_trcdta structure' ) ; RETURN 125 ENDIF 126 ! 127 DO jn = 1, jptra 128 IF( ln_trc_ini(jn) ) THEN ! update passive tracers arrays with input data read from file 129 jl = n_trc_index(jn) 130 slf_i(jl) = sn_trcdta(jn) 131 rf_trfac(jl) = rn_trfac(jn) 132 ALLOCATE( sf_trcdta(jl)%fnow(jpi,jpj,jpk) , STAT=ierr2 ) 133 IF( sn_trcdta(jn)%ln_tint ) ALLOCATE( sf_trcdta(jl)%fdta(jpi,jpj,jpk,2) , STAT=ierr3 ) 134 IF( ierr2 + ierr3 > 0 ) THEN 135 CALL ctl_stop( 'trc_dta : unable to allocate passive tracer data arrays' ) ; RETURN 136 ENDIF 137 ENDIF 138 ! 139 ENDDO 140 ! ! fill sf_trcdta with slf_i and control print 141 CALL fld_fill( sf_trcdta, slf_i, cn_dir, 'trc_dta', 'Passive tracer data', 'namtrc' ) 142 ! 143 ENDIF 144 ! 145 END SUBROUTINE trc_dta_init 146 147 148 SUBROUTINE trc_dta( kt, ptrc ) 46 149 !!---------------------------------------------------------------------- 47 150 !! *** ROUTINE trc_dta *** 151 !! 152 !! ** Purpose : provides passive tracer data at kt 153 !! 154 !! ** Method : - call fldread routine 155 !! - s- or mixed z-s coordinate: vertical interpolation on model mesh 156 !! - ln_trcdmp=F: deallocates the data structure as they are not used 48 157 !! 49 !! ** Purpose : Reads passive tracer data (Levitus monthly data) 50 !! 51 !! ** Method : Read on unit numtr the interpolated tracer concentra- 52 !! tion onto the global grid. Data begin at january. 53 !! The value is centered at the middle of month. 54 !! In the opa model, kt=1 agree with january 1. 55 !! At each time step, a linear interpolation is applied between 56 !! two monthly values. 57 !!---------------------------------------------------------------------- 58 INTEGER, INTENT(in) :: kt ! ocean time-step 59 !! 60 CHARACTER (len=39) :: clname(jptra) 61 INTEGER, PARAMETER :: jpmonth = 12 ! number of months 62 INTEGER :: ji, jj, jn, jl 63 INTEGER :: imois, iman, i15, ik ! temporary integers 64 REAL(wp) :: zxy, zl 65 !!gm HERE the daymod should be used instead of computation of month and co !! 66 !!gm better in case of real calandar and leap-years ! 67 !!---------------------------------------------------------------------- 68 69 DO jn = 1, jptra 70 71 IF( lutini(jn) ) THEN 72 73 IF ( kt == nit000 ) THEN 74 !! 3D tracer data 75 IF(lwp)WRITE(numout,*) 76 IF(lwp)WRITE(numout,*) ' dta_trc: reading tracer' 77 IF(lwp)WRITE(numout,*) ' data file ', jn, ctrcnm(jn) 78 IF(lwp)WRITE(numout,*) 79 nlectr(jn) = 0 158 !! ** Action : ptrc passive tracer data on medl mesh and interpolated at time-step kt 159 !!---------------------------------------------------------------------- 160 INTEGER , INTENT(in ) :: kt ! ocean time-step 161 REAL(wp), DIMENSION(:,:,:,:), INTENT( out) :: ptrc ! passive tracer data 162 ! 163 INTEGER :: ji, jj, jk, jl, jn, jkk, ik ! dummy loop indicies 164 REAL(wp):: zl, zi 165 REAL(wp), DIMENSION(jpk) :: ztp ! 1D workspace 166 CHARACTER(len=100) :: clndta 167 !!---------------------------------------------------------------------- 168 ! 169 IF( nb_trcdta > 0 ) THEN 170 ! 171 CALL fld_read( kt, 1, sf_trcdta ) !== read data at kt time step ==! 172 ! 173 DO jn = 1, ntra 174 ptrc(:,:,:,jn) = sf_trcdta(jn)%fnow(:,:,:) ! NO mask 175 ENDDO 176 ! 177 IF( ln_sco ) THEN !== s- or mixed s-zps-coordinate ==! 178 ! 179 IF( kt == nit000 .AND. lwp )THEN 180 WRITE(numout,*) 181 WRITE(numout,*) 'trc_dta: interpolates passive tracer data onto the s- or mixed s-z-coordinate mesh' 80 182 ENDIF 81 ! Initialization 82 iman = jpmonth 83 i15 = nday / 16 84 imois = nmonth + i15 -1 85 IF( imois == 0 ) imois = iman 86 87 88 ! First call kt=nit000 89 ! -------------------- 90 91 IF ( kt == nit000 .AND. nlectr(jn) == 0 ) THEN 92 ntrc1(jn) = 0 93 IF(lwp) WRITE(numout,*) ' trc_dta : Levitus tracer data monthly fields' 94 ! open file 95 # if defined key_pisces 96 clname(jn) = 'data_1m_'//TRIM(ctrcnm(jn))//'_nomask' 97 # else 98 clname(jn) = TRIM(ctrcnm(jn)) 99 # endif 100 CALL iom_open ( clname(jn), numtr(jn) ) 101 102 ENDIF 103 104 # if defined key_pisces 105 ! Read montly file 106 IF( ( kt == nit000 .AND. nlectr(jn) == 0) .OR. imois /= ntrc1(jn) ) THEN 107 nlectr(jn) = 1 108 109 ! Calendar computation 110 111 ! ntrc1 number of the first file record used in the simulation 112 ! ntrc2 number of the last file record 113 114 ntrc1(jn) = imois 115 ntrc2(jn) = ntrc1(jn) + 1 116 ntrc1(jn) = MOD( ntrc1(jn), iman ) 117 IF ( ntrc1(jn) == 0 ) ntrc1(jn) = iman 118 ntrc2(jn) = MOD( ntrc2(jn), iman ) 119 IF ( ntrc2(jn) == 0 ) ntrc2(jn) = iman 120 IF(lwp) WRITE(numout,*) 'first record file used ntrc1 ', ntrc1(jn) 121 IF(lwp) WRITE(numout,*) 'last record file used ntrc2 ', ntrc2(jn) 122 123 ! Read montly passive tracer data Levitus 124 125 CALL iom_get ( numtr(jn), jpdom_data, ctrcnm(jn), tracdta(:,:,:,jn,1), ntrc1(jn) ) 126 CALL iom_get ( numtr(jn), jpdom_data, ctrcnm(jn), tracdta(:,:,:,jn,2), ntrc2(jn) ) 127 128 IF(lwp) THEN 129 WRITE(numout,*) 130 WRITE(numout,*) ' read tracer data ', ctrcnm(jn),' ok' 131 WRITE(numout,*) 183 ! 184 DO jn = 1, ntra 185 DO jj = 1, jpj ! vertical interpolation of T & S 186 DO ji = 1, jpi 187 DO jk = 1, jpk ! determines the intepolated T-S profiles at each (i,j) points 188 zl = fsdept_0(ji,jj,jk) 189 IF( zl < gdept_0(1 ) ) THEN ! above the first level of data 190 ztp(jk) = ptrc(ji,jj,1 ,jn) 191 ELSEIF( zl > gdept_0(jpk) ) THEN ! below the last level of data 192 ztp(jk) = ptrc(ji,jj,jpkm1,jn) 193 ELSE ! inbetween : vertical interpolation between jkk & jkk+1 194 DO jkk = 1, jpkm1 ! when gdept(jkk) < zl < gdept(jkk+1) 195 IF( (zl-gdept_0(jkk)) * (zl-gdept_0(jkk+1)) <= 0._wp ) THEN 196 zi = ( zl - gdept_0(jkk) ) / (gdept_0(jkk+1)-gdept_0(jkk)) 197 ztp(jk) = ptrc(ji,jj,jkk,jn) + ( ptrc(ji,jj,jkk+1,jn) - ptrc(ji,jj,jkk,jn) ) * zi 198 ENDIF 199 END DO 200 ENDIF 201 END DO 202 DO jk = 1, jpkm1 203 ptrc(ji,jj,jk,jn) = ztp(jk) * tmask(ji,jj,jk) ! mask required for mixed zps-s-coord 204 END DO 205 ptrc(ji,jj,jpk,jn) = 0._wp 206 END DO 207 END DO 208 ENDDO 209 ! 210 ELSE !== z- or zps- coordinate ==! 211 ! 212 DO jn = 1, ntra 213 ptrc(:,:,:,jn) = ptrc(:,:,:,jn) * tmask(:,:,:) ! Mask 214 ! 215 IF( ln_zps ) THEN ! zps-coordinate (partial steps) interpolation at the last ocean level 216 DO jj = 1, jpj 217 DO ji = 1, jpi 218 ik = mbkt(ji,jj) 219 IF( ik > 1 ) THEN 220 zl = ( gdept_0(ik) - fsdept_0(ji,jj,ik) ) / ( gdept_0(ik) - gdept_0(ik-1) ) 221 ptrc(ji,jj,ik,jn) = (1.-zl) * ptrc(ji,jj,ik,jn) + zl * ptrc(ji,jj,ik-1,jn) 222 ENDIF 223 END DO 224 END DO 132 225 ENDIF 133 134 ! Apply Mask 135 DO jl = 1, 2 136 tracdta(:,:,: ,jn,jl) = tracdta(:,:,:,jn,jl) * tmask(:,:,:) 137 tracdta(:,:,jpk,jn,jl) = 0. 138 IF( ln_zps ) THEN ! z-coord. with partial steps 139 DO jj = 1, jpj ! interpolation of temperature at the last level 140 DO ji = 1, jpi 141 ik = mbkt(ji,jj) 142 IF( ik > 2 ) THEN 143 zl = ( gdept_0(ik) - fsdept_0(ji,jj,ik) ) / ( gdept_0(ik) - gdept_0(ik-1) ) 144 tracdta(ji,jj,ik,jn,jl) = (1.-zl) * tracdta(ji,jj,ik ,jn,jl) & 145 & + zl * tracdta(ji,jj,ik-1,jn,jl) 146 ENDIF 147 END DO 148 END DO 149 ENDIF 150 151 END DO 152 153 ENDIF 154 155 IF(lwp) THEN 156 WRITE(numout,*) ctrcnm(jn), 'Levitus month ', ntrc1(jn), ntrc2(jn) 226 ENDDO 227 ! 228 ENDIF 229 ! 230 DO jn = 1, ntra 231 ptrc(:,:,:,jn) = ptrc(:,:,:,jn) * rf_trfac(jn) ! multiplicative factor 232 ENDDO 233 ! 234 IF( lwp .AND. kt == nit000 ) THEN 235 DO jn = 1, ntra 236 clndta = TRIM( sf_trcdta(jn)%clvar ) 237 WRITE(numout,*) ''//clndta//' data ' 157 238 WRITE(numout,*) 158 WRITE(numout,*) ' Levitus month = ', ntrc1(jn), ' level = 1' 159 CALL prihre( tracdta(1,1,1,jn,1), jpi, jpj, 1, jpi, 20, 1 & 160 & ,jpj, 20, 1., numout ) 161 WRITE(numout,*) ' Levitus month = ', ntrc1(jn), ' level = ',jpk/2 162 CALL prihre( tracdta(1,1,jpk/2,jn,1), jpi, jpj, 1, jpi, & 163 & 20, 1, jpj, 20, 1., numout ) 164 WRITE(numout,*) ' Levitus month = ',ntrc1(jn),' level = ',jpkm1 165 CALL prihre( tracdta(1,1,jpkm1,jn,1), jpi, jpj, 1, jpi, & 166 & 20, 1, jpj, 20, 1., numout ) 167 ENDIF 168 169 ! At every time step compute temperature data 170 zxy = FLOAT( nday + 15 - 30 * i15 ) / 30. 171 trdta(:,:,:,jn) = ( 1. - zxy ) * tracdta(:,:,:,jn,1) & 172 & + zxy * tracdta(:,:,:,jn,2) 173 174 IF( jn == jpno3 ) trdta(:,:,:,jn) = trdta(:,:,:,jn) * 7.6e-6 175 IF( jn == jpdic ) trdta(:,:,:,jn) = trdta(:,:,:,jn) * 1.0e-6 176 IF( jn == jptal ) trdta(:,:,:,jn) = trdta(:,:,:,jn) * 1.0e-6 177 IF( jn == jpoxy ) trdta(:,:,:,jn) = trdta(:,:,:,jn) * 44.6e-6 178 IF( jn == jpsil ) trdta(:,:,:,jn) = trdta(:,:,:,jn) * 1.0e-6 179 IF( jn == jppo4 ) trdta(:,:,:,jn) = trdta(:,:,:,jn) * 122.0e-6 180 181 ! Close the file 182 ! -------------- 183 184 IF( kt == nitend ) CALL iom_close( numtr(jn) ) 185 186 # else 187 ! Read init file only 188 IF( kt == nit000 ) THEN 189 ntrc1(jn) = 1 190 CALL iom_get ( numtr(jn), jpdom_data, ctrcnm(jn), trdta(:,:,:,jn), ntrc1(jn) ) 191 trdta(:,:,:,jn) = trdta(:,:,:,jn) * tmask(:,:,:) 192 CALL iom_close ( numtr(jn) ) 193 ENDIF 194 # endif 195 ENDIF 196 197 END DO 198 ! 239 WRITE(numout,*)' level = 1' 240 CALL prihre( ptrc(:,:,1 ,jn), jpi, jpj, 1, jpi, 20, 1, jpj, 20, 1., numout ) 241 WRITE(numout,*)' level = ', jpk/2 242 CALL prihre( ptrc(:,:,jpk/2,jn), jpi, jpj, 1, jpi, 20, 1, jpj, 20, 1., numout ) 243 WRITE(numout,*)' level = ', jpkm1 244 CALL prihre( ptrc(:,:,jpkm1,jn), jpi, jpj, 1, jpi, 20, 1, jpj, 20, 1., numout ) 245 WRITE(numout,*) 246 ENDDO 247 ENDIF 248 ! 249 IF( .NOT.ln_trcdmp ) THEN !== deallocate data structure ==! 250 ! (data used only for initialisation) 251 IF(lwp) WRITE(numout,*) 'trc_dta: deallocate data arrays as they are only use to initialize the run' 252 DO jn = 1, ntra 253 DEALLOCATE( sf_trcdta(jn)%fnow ) ! arrays in the structure 254 IF( sf_trcdta(jn)%ln_tint ) DEALLOCATE( sf_trcdta(jn)%fdta ) 255 ENDDO 256 ! 257 ENDIF 258 ! 259 ENDIF 260 ! 199 261 END SUBROUTINE trc_dta 200 201 202 INTEGER FUNCTION trc_dta_alloc()203 !!----------------------------------------------------------------------204 !! *** ROUTINE trc_dta_alloc ***205 !!----------------------------------------------------------------------206 ALLOCATE( trdta (jpi,jpj,jpk,jptra ) , &207 & tracdta(jpi,jpj,jpk,jptra,2) , &208 & nlectr(jptra) , ntrc1(jptra) , ntrc2(jptra) , STAT=trc_dta_alloc)209 !210 IF( trc_dta_alloc /= 0 ) CALL ctl_warn('trc_dta_alloc : failed to allocate arrays')211 !212 END FUNCTION trc_dta_alloc213 214 262 #else 215 263 !!---------------------------------------------------------------------- 216 264 !! Dummy module NO 3D passive tracer data 217 265 !!---------------------------------------------------------------------- 218 LOGICAL , PUBLIC, PARAMETER :: lk_dtatrc = .FALSE. !: temperature data flag219 266 CONTAINS 220 267 SUBROUTINE trc_dta( kt ) ! Empty routine … … 222 269 END SUBROUTINE trc_dta 223 270 #endif 224 225 271 !!====================================================================== 226 272 END MODULE trcdta -
branches/2011/dev_r2787_LOCEAN3_TRA_TRP/NEMOGCM/NEMO/TOP_SRC/trcini.F90
r2715 r2819 16 16 !! top_alloc : allocate the TOP arrays 17 17 !!---------------------------------------------------------------------- 18 USE oce_trc 19 USE trc 20 USE trcrst 18 USE oce_trc ! shared variables between ocean and passive tracers 19 USE trc ! passive tracers common variables 20 USE trcrst ! passive tracers restart 21 21 USE trcnam ! Namelist read 22 22 USE trcini_cfc ! CFC initialisation … … 25 25 USE trcini_c14b ! C14 bomb initialisation 26 26 USE trcini_my_trc ! MY_TRC initialisation 27 USE trcdta 28 USE daymod 27 USE trcdta ! initialisation form files 28 USE daymod ! calendar manager 29 29 USE zpshde ! partial step: hor. derivative (zps_hde routine) 30 30 USE prtctl_trc ! Print control passive tracers (prt_ctl_trc_init routine) … … 56 56 !! or read data or analytical formulation 57 57 !!--------------------------------------------------------------------- 58 INTEGER :: jk, jn ! dummy loop indices 58 INTEGER :: jk, jn, jl ! dummy loop indices 59 INTEGER :: ierr ! local integer 59 60 CHARACTER (len=25) :: charout 61 REAL(wp), ALLOCATABLE, DIMENSION(:,:,:,:) :: ztrcdta ! 4D workspace 60 62 !!--------------------------------------------------------------------- 61 63 … … 65 67 66 68 CALL top_alloc() ! allocate TOP arrays 69 70 IF( ln_dm2dc .AND. ( lk_pisces .OR. lk_lobster ) ) & 71 & CALL ctl_stop( ' The diurnal cycle is not compatible with PISCES or LOBSTER ' ) 72 73 IF( nn_cla == 1 ) & 74 & CALL ctl_stop( ' Cross Land Advection not yet implemented with passive tracer ; nn_cla must be 0' ) 67 75 68 76 ! ! masked grid volume … … 71 79 END DO 72 80 73 ! ! total volume of the ocean 74 #if ! defined key_degrad 75 areatot = glob_sum( cvol(:,:,:) ) 76 #else 77 areatot = glob_sum( cvol(:,:,:) * facvol(:,:,:) ) ! degrad option: reduction by facvol 78 #endif 81 ! ! total volume of the ocean ( degrad option: reduction by facvol ) 82 IF( .NOT.lk_degrad ) THEN ; areatot = glob_sum( cvol(:,:,:) ) 83 ELSE ; areatot = glob_sum( cvol(:,:,:) * facvol(:,:,:) ) 84 ENDIF 79 85 80 86 CALL trc_nam ! read passive tracers namelists 81 82 ! ! restart for passive tracer (input)83 IF( ln_rsttr ) THEN84 IF(lwp) WRITE(numout,*) ' read a restart file for passive tracer : ', cn_trcrst_in85 IF(lwp) WRITE(numout,*) ' '86 ELSE87 IF( lwp .AND. lk_dtatrc ) THEN88 DO jn = 1, jptra89 IF( lutini(jn) ) & ! open input FILE only IF lutini(jn) is true90 & WRITE(numout,*) ' read an initial file for passive tracer number :', jn, ' traceur : ', ctrcnm(jn)91 END DO92 ENDIF93 IF( lwp ) WRITE(numout,*)94 ENDIF95 96 IF( ln_dm2dc .AND. ( lk_pisces .OR. lk_lobster ) ) &97 & CALL ctl_stop( ' The diurnal cycle is not compatible with PISCES or LOBSTER ' )98 99 IF( nn_cla == 1 ) &100 & CALL ctl_stop( ' Cross Land Advection not yet implemented with passive tracer ; nn_cla must be 0' )101 87 102 88 IF( lk_lobster ) THEN ; CALL trc_ini_lobster ! LOBSTER bio-model … … 119 105 ELSE ; IF(lwp) WRITE(numout,*) ' MY_TRC not used' 120 106 ENDIF 107 108 IF( ln_trcdta ) CALL trc_dta_init 121 109 122 110 IF( ln_rsttr ) THEN … … 130 118 CALL day_init ! set calendar 131 119 ENDIF 132 #if defined key_dtatrc 133 CALL trc_dta( nit000 ) ! Initialization of tracer from a file that may also be used for damping 134 DO jn = 1, jptra 135 IF( lutini(jn) ) trn(:,:,:,jn) = trdta(:,:,:,jn) * tmask(:,:,:) ! initialisation from file if required 136 END DO 137 #endif 120 IF( ln_trcdta .AND. nb_trcdta > 0 ) THEN ! Initialisation of tracer from a file that may also be used for damping 121 ALLOCATE( ztrcdta(jpi,jpj,jpk,nb_trcdta), STAT=ierr ) 122 IF( ierr > 0 ) THEN 123 CALL ctl_stop( 'trc_ini: unable to allocate ztrcdta array' ) ; RETURN 124 ENDIF 125 ! 126 CALL trc_dta( nit000, ztrcdta ) ! read tracer data at nit000 127 ! 128 DO jn = 1, jptra 129 IF( ln_trc_ini(jn) ) THEN ! update passive tracers arrays with input data read from file 130 jl = n_trc_index(jn) 131 trn(:,:,:,jn) = ztrcdta(:,:,:,jl) * tmask(:,:,:) 132 ENDIF 133 ENDDO 134 DEALLOCATE( ztrcdta ) 135 ENDIF 136 ! 138 137 trb(:,:,:,:) = trn(:,:,:,:) 139 138 ! … … 147 146 148 147 ! 149 trai = 0._wp ! Computation content of all tracers148 trai(:) = 0._wp ! Computation content of all tracers ( degrad option: reduction by facvol ) 150 149 DO jn = 1, jptra 151 #if ! defined key_degrad 152 trai = trai + glob_sum( trn(:,:,:,jn) * cvol(:,:,:) ) 153 #else 154 trai = trai + glob_sum( trn(:,:,:,jn) * cvol(:,:,:) * facvol(:,:,:) ) ! degrad option: reduction by facvol 155 #endif 150 IF( .NOT.lk_degrad ) THEN ; trai(jn) = glob_sum( trn(:,:,:,jn) * cvol(:,:,:) ) 151 ELSE ; trai(jn) = glob_sum( trn(:,:,:,jn) * cvol(:,:,:) * facvol(:,:,:) ) 152 ENDIF 156 153 END DO 157 154 … … 161 158 WRITE(numout,*) ' *** Total number of passive tracer jptra = ', jptra 162 159 WRITE(numout,*) ' *** Total volume of ocean = ', areatot 163 WRITE(numout,*) ' *** Total inital content of all tracers = ', trai 160 WRITE(numout,*) ' *** Total inital content of all tracers ' 161 DO jn = 1, jptra 162 WRITE(numout,*) ' tracer nb : ', jn, ' name : ', ctrcnm(jn), ' initial content :', trai(jn) 163 ENDDO 164 164 WRITE(numout,*) 165 165 ENDIF … … 186 186 USE trczdf , ONLY: trc_zdf_alloc 187 187 USE trdmod_trc_oce, ONLY: trd_mod_trc_oce_alloc 188 #if ! defined key_iomput 189 USE trcdia , ONLY: trc_dia_alloc 190 #endif 191 #if defined key_trcdmp 192 USE trcdmp , ONLY: trc_dmp_alloc 193 #endif 194 #if defined key_dtatrc 195 USE trcdta , ONLY: trc_dta_alloc 196 #endif 197 #if defined key_trdmld_trc || defined key_esopa 188 #if defined key_trdmld_trc 198 189 USE trdmld_trc , ONLY: trd_mld_trc_alloc 199 190 #endif … … 207 198 ierr = ierr + trc_zdf_alloc() 208 199 ierr = ierr + trd_mod_trc_oce_alloc() 209 #if ! defined key_iomput 210 ierr = ierr + trc_dia_alloc() 211 #endif 212 #if defined key_trcdmp 213 ierr = ierr + trc_dmp_alloc() 214 #endif 215 #if defined key_dtatrc 216 ierr = ierr + trc_dta_alloc() 217 #endif 218 #if defined key_trdmld_trc || defined key_esopa 200 #if defined key_trdmld_trc 219 201 ierr = ierr + trd_mld_trc_alloc() 220 202 #endif -
branches/2011/dev_r2787_LOCEAN3_TRA_TRP/NEMOGCM/NEMO/TOP_SRC/trcnam.F90
r2715 r2819 18 18 !! trc_nam : Read and print options for the passive tracer run (namelist) 19 19 !!---------------------------------------------------------------------- 20 USE oce_trc 21 USE trc 20 USE oce_trc ! shared variables between ocean and passive tracers 21 USE trc ! passive tracers common variables 22 22 USE trcnam_trp ! Transport namelist 23 23 USE trcnam_lobster ! LOBSTER namelist … … 26 26 USE trcnam_c14b ! C14 SMS namelist 27 27 USE trcnam_my_trc ! MY_TRC SMS namelist 28 USE trdmod_oce 28 29 USE trdmod_trc_oce 30 USE iom ! I/O manager 29 31 30 32 IMPLICIT NONE … … 53 55 !! ( (LOBSTER, PISCES, CFC, MY_TRC ) 54 56 !!--------------------------------------------------------------------- 55 INTEGER :: jn 56 57 INTEGER :: jn, ierr 57 58 ! Definition of a tracer as a structure 58 TYPE PTRACER 59 CHARACTER(len = 20) :: clsname !: short name 60 CHARACTER(len = 80 ) :: cllname !: long name 61 CHARACTER(len = 20 ) :: clunit !: unit 62 LOGICAL :: llinit !: read in a file or not 63 LOGICAL :: llsave !: save the tracer or not 64 END TYPE PTRACER 65 66 TYPE(PTRACER) , DIMENSION(jptra) :: sn_tracer 67 59 TYPE(PTRACER), DIMENSION(jptra) :: sn_tracer ! type of tracer for saving if not key_iomput 68 60 !! 69 NAMELIST/namtrc/ 70 cn_trcrst_in, cn_trcrst_out, sn_tracer61 NAMELIST/namtrc/ nn_dttrc, nn_writetrc, ln_rsttr, nn_rsttr, & 62 & cn_trcrst_in, cn_trcrst_out, sn_tracer, ln_trcdta 71 63 #if defined key_trdmld_trc || defined key_trdtrc 72 64 NAMELIST/namtrc_trd/ nn_trd_trc, nn_ctls_trc, rn_ucf_trc, & 73 ln_trdmld_trc_restart, ln_trdmld_trc_instant, &74 cn_trdrst_trc_in, cn_trdrst_trc_out, ln_trdtrc65 & ln_trdmld_trc_restart, ln_trdmld_trc_instant, & 66 & cn_trdrst_trc_in, cn_trdrst_trc_out, ln_trdtrc 75 67 #endif 68 NAMELIST/namtrc_dia/ ln_diatrc, ln_diabio, nn_writedia, nn_writebio 76 69 77 70 !!--------------------------------------------------------------------- … … 84 77 ! Namelist nattrc (files) 85 78 ! ---------------------------------------------- 86 nn_dttrc = 1 ! default values87 nn_writetrc = 1088 ln_rsttr = .FALSE.89 nn_rsttr = 079 nn_dttrc = 1 ! default values 80 nn_writetrc = 10 81 ln_rsttr = .FALSE. 82 nn_rsttr = 0 90 83 cn_trcrst_in = 'restart_trc' 91 84 cn_trcrst_out = 'restart_trc' 85 ! 92 86 DO jn = 1, jptra 93 WRITE( ctrcnm(jn),'("TR_",I1)' ) jn94 WRITE( ctrcnl(jn),'("TRACER NUMBER ",I1)') jn95 ctrcun(jn)= 'mmole/m3'96 lutini(jn) = .FALSE.97 lutsav(jn) = .TRUE.87 WRITE( sn_tracer(jn)%clsname,'("TR_",I1)' ) jn 88 WRITE( sn_tracer(jn)%cllname,'("TRACER NUMBER ",I1)') jn 89 sn_tracer(jn)%clunit = 'mmole/m3' 90 sn_tracer(jn)%llinit = .FALSE. 91 sn_tracer(jn)%llsave = .TRUE. 98 92 END DO 93 ln_trcdta = .FALSE. 94 99 95 100 96 REWIND( numnat ) ! read nattrc … … 102 98 103 99 DO jn = 1, jptra 104 ctrcnm (jn) = TRIM( sn_tracer(jn)%clsname )105 ctrc nl(jn) = TRIM( sn_tracer(jn)%cllname )106 ctrcun (jn) = TRIM( sn_tracer(jn)%clunit )107 l utini(jn) = sn_tracer(jn)%llinit108 l utsav(jn) = sn_tracer(jn)%llsave100 ctrcnm (jn) = TRIM( sn_tracer(jn)%clsname ) 101 ctrcln (jn) = TRIM( sn_tracer(jn)%cllname ) 102 ctrcun (jn) = TRIM( sn_tracer(jn)%clunit ) 103 ln_trc_ini(jn) = sn_tracer(jn)%llinit 104 ln_trc_wri(jn) = sn_tracer(jn)%llsave 109 105 END DO 110 106 … … 113 109 WRITE(numout,*) 114 110 WRITE(numout,*) ' Namelist : namtrc' 115 WRITE(numout,*) ' time step freq. for pass. trac. nn_dttrc= ', nn_dttrc116 WRITE(numout,*) ' frequency of outputs for passive tracers nn_writetrc = ', nn_writetrc117 WRITE(numout,*) ' restart LOGICAL for passive tr. ln_rsttr = ', ln_rsttr118 WRITE(numout,*) ' control of time step for p. tr. nn_rsttr = ', nn_rsttr111 WRITE(numout,*) ' time step freq. for passive tracer nn_dttrc = ', nn_dttrc 112 WRITE(numout,*) ' restart for passive tracer ln_rsttr = ', ln_rsttr 113 WRITE(numout,*) ' control of time step for passive tracer nn_rsttr = ', nn_rsttr 114 WRITE(numout,*) ' Read inputs data from file ln_trcdta = ', ln_trcdta 119 115 WRITE(numout,*) ' ' 120 116 DO jn = 1, jptra 121 WRITE(numout,*) ' tracer nb : ', jn 122 WRITE(numout,*) ' short name : ', ctrcnm(jn) 123 WRITE(numout,*) ' long name : ', ctrcnl(jn) 124 WRITE(numout,*) ' unit : ', ctrcun(jn) 125 WRITE(numout,*) ' initial value in FILE : ', lutini(jn) 126 WRITE(numout,*) ' ' 117 WRITE(numout,*) ' tracer nb : ', jn, ' short name : ', ctrcnm(jn) 127 118 END DO 119 WRITE(numout,*) ' ' 128 120 ENDIF 129 121 130 122 rdttrc(:) = rdttra(:) * FLOAT( nn_dttrc ) ! vertical profile of passive tracer time-step 131 123 132 IF(lwp) WRITE(numout,*) 133 IF(lwp) WRITE(numout,*) ' Passive Tracer time step rdttrc = ', rdttrc(1) 134 IF(lwp) WRITE(numout,*) 135 136 #if defined key_trdmld_trc || defined key_trdtrc 137 nn_trd_trc = 20 138 nn_ctls_trc = 9 139 rn_ucf_trc = 1. 140 ln_trdmld_trc_instant = .TRUE. 141 ln_trdmld_trc_restart =.FALSE. 142 cn_trdrst_trc_in = "restart_mld_trc" 143 cn_trdrst_trc_out = "restart_mld_trc" 144 ln_trdtrc(:) = .FALSE. 124 IF(lwp) THEN ! control print 125 WRITE(numout,*) 126 WRITE(numout,*) ' Passive Tracer time step rdttrc = ', rdttrc(1) 127 WRITE(numout,*) 128 ENDIF 129 130 ln_diatrc = .FALSE. 131 ln_diabio = .FALSE. 132 nn_writedia = 10 133 nn_writebio = 10 145 134 146 135 REWIND( numnat ) ! namelist namtoptrd : passive tracer trends diagnostic 147 READ ( numnat, namtrc_ trd)148 149 IF(lwp) THEN136 READ ( numnat, namtrc_dia ) 137 138 IF(lwp) THEN 150 139 WRITE(numout,*) 151 WRITE(numout,*) ' trd_mld_trc_init : read namelist namtrc_trd ' 152 WRITE(numout,*) ' ~~~~~~~~~~~~~~~~ ' 153 WRITE(numout,*) ' * frequency of trends diagnostics nn_trd_trc = ', nn_trd_trc 154 WRITE(numout,*) ' * control surface type nn_ctls_trc = ', nn_ctls_trc 155 WRITE(numout,*) ' * restart for ML diagnostics ln_trdmld_trc_restart = ', ln_trdmld_trc_restart 156 WRITE(numout,*) ' * flag to diagnose trends of ' 157 WRITE(numout,*) ' instantantaneous or mean ML T/S ln_trdmld_trc_instant = ', ln_trdmld_trc_instant 158 WRITE(numout,*) ' * unit conversion factor rn_ucf_trc = ', rn_ucf_trc 159 DO jn = 1, jptra 160 IF( ln_trdtrc(jn) ) WRITE(numout,*) ' compute ML trends for tracer number :', jn 161 END DO 162 ENDIF 163 #endif 140 WRITE(numout,*) 141 WRITE(numout,*) ' Namelist : namtrc_dia' 142 WRITE(numout,*) ' save additionnal diagnostics arrays ln_diatrc = ', ln_diatrc 143 WRITE(numout,*) ' save additionnal biology diagnostics arrays ln_diabio = ', ln_diabio 144 WRITE(numout,*) ' frequency of outputs for additional arrays nn_writedia = ', nn_writedia 145 WRITE(numout,*) ' frequency of outputs for biological trends nn_writebio = ', nn_writebio 146 WRITE(numout,*) ' ' 147 ENDIF 148 149 IF( ln_diatrc .AND. .NOT. lk_iomput ) THEN 150 ALLOCATE( trc2d(jpi,jpj,jpdia2d), trc3d(jpi,jpj,jpk,jpdia3d), & 151 & ctrc2d(jpdia2d), ctrc2l(jpdia2d), ctrc2u(jpdia2d) , & 152 & ctrc3d(jpdia3d), ctrc3l(jpdia3d), ctrc3u(jpdia3d) , STAT = ierr ) 153 IF( ierr > 0 ) CALL ctl_stop( 'STOP', 'trcnam: unable to allocate add. diag. array' ) 154 ENDIF 155 156 IF( ( ln_diabio .AND. .NOT. lk_iomput ) .OR. l_trdtrc ) THEN 157 ALLOCATE( trbio (jpi,jpj,jpk,jpdiabio) , & 158 & ctrbio(jpdiabio), ctrbil(jpdiabio), ctrbiu(jpdiabio), STAT = ierr ) 159 IF( ierr > 0 ) CALL ctl_stop( 'STOP', 'trcnam: unable to allocate bio. diag. array' ) 160 ENDIF 164 161 165 162 ! namelist of transport 166 163 ! --------------------- 167 164 CALL trc_nam_trp 165 166 167 IF( ln_trcdmp .AND. .NOT.ln_trcdta ) THEN 168 CALL ctl_warn( 'trc_nam: passive tracer damping requires data from files we set ln_trcdta to TRUE' ) 169 ln_trcdta = .TRUE. 170 ENDIF 171 ! 172 IF( ln_rsttr .AND. .NOT.ln_trcdmp .AND. ln_trcdta ) THEN 173 CALL ctl_warn( 'trc_nam: passive tracer restart and data intialisation, ', & 174 & 'we keep the restart values and set ln_trcdta to FALSE' ) 175 ln_trcdta = .FALSE. 176 ENDIF 177 ! 178 IF( .NOT.ln_trcdta ) THEN 179 ln_trc_ini(:) = .FALSE. 180 ENDIF 181 182 IF(lwp) THEN ! control print 183 IF( ln_rsttr ) THEN 184 WRITE(numout,*) 185 WRITE(numout,*) ' read a restart file for passive tracer : ', TRIM( cn_trcrst_in ) 186 WRITE(numout,*) 187 ELSE 188 IF( .NOT.ln_trcdta ) THEN 189 WRITE(numout,*) 190 WRITE(numout,*) ' All the passive tracers are initialised with constant values ' 191 WRITE(numout,*) 192 ENDIF 193 ENDIF 194 ENDIF 195 196 197 #if defined key_trdmld_trc || defined key_trdtrc 198 nn_trd_trc = 20 199 nn_ctls_trc = 9 200 rn_ucf_trc = 1. 201 ln_trdmld_trc_instant = .TRUE. 202 ln_trdmld_trc_restart =.FALSE. 203 cn_trdrst_trc_in = "restart_mld_trc" 204 cn_trdrst_trc_out = "restart_mld_trc" 205 ln_trdtrc(:) = .FALSE. 206 207 REWIND( numnat ) ! namelist namtoptrd : passive tracer trends diagnostic 208 READ ( numnat, namtrc_trd ) 209 210 IF(lwp) THEN 211 WRITE(numout,*) 212 WRITE(numout,*) ' trd_mld_trc_init : read namelist namtrc_trd ' 213 WRITE(numout,*) ' ~~~~~~~~~~~~~~~~ ' 214 WRITE(numout,*) ' * frequency of trends diagnostics nn_trd_trc = ', nn_trd_trc 215 WRITE(numout,*) ' * control surface type nn_ctls_trc = ', nn_ctls_trc 216 WRITE(numout,*) ' * restart for ML diagnostics ln_trdmld_trc_restart = ', ln_trdmld_trc_restart 217 WRITE(numout,*) ' * flag to diagnose trends of ' 218 WRITE(numout,*) ' instantantaneous or mean ML T/S ln_trdmld_trc_instant = ', ln_trdmld_trc_instant 219 WRITE(numout,*) ' * unit conversion factor rn_ucf_trc = ', rn_ucf_trc 220 DO jn = 1, jptra 221 IF( ln_trdtrc(jn) ) WRITE(numout,*) ' compute ML trends for tracer number :', jn 222 END DO 223 ENDIF 224 #endif 168 225 169 226 -
branches/2011/dev_r2787_LOCEAN3_TRA_TRP/NEMOGCM/NEMO/TOP_SRC/trcrst.F90
r2715 r2819 285 285 286 286 INTEGER :: jn 287 REAL(wp) :: zdiag_var, zdiag_varmin, zdiag_varmax, zdiag_tot 288 REAL(wp) :: zder 287 REAL(wp) :: ztraf, zmin, zmax, zmean, zdrift 289 288 !!---------------------------------------------------------------------- 290 289 … … 296 295 ENDIF 297 296 298 zdiag_tot = 0.e0 299 DO jn = 1, jptra 300 # if defined key_degrad 301 zdiag_var = glob_sum( trn(:,:,:,jn) * cvol(:,:,:) * facvol(:,:,:) ) 302 # else 303 zdiag_var = glob_sum( trn(:,:,:,jn) * cvol(:,:,:) ) 304 # endif 305 zdiag_varmin = MINVAL( trn(:,:,:,jn), mask= ((tmask*SPREAD(tmask_i,DIM=3,NCOPIES=jpk).NE.0.)) ) 306 zdiag_varmax = MAXVAL( trn(:,:,:,jn), mask= ((tmask*SPREAD(tmask_i,DIM=3,NCOPIES=jpk).NE.0.)) ) 297 DO jn = 1, jptra 298 IF( .NOT.lk_degrad ) THEN ; ztraf = glob_sum( trn(:,:,:,jn) * cvol(:,:,:) ) 299 ELSE ; ztraf = glob_sum( trn(:,:,:,jn) * cvol(:,:,:) * facvol(:,:,:) ) 300 ENDIF 301 zmin = MINVAL( trn(:,:,:,jn), mask= ((tmask*SPREAD(tmask_i,DIM=3,NCOPIES=jpk).NE.0.)) ) 302 zmax = MAXVAL( trn(:,:,:,jn), mask= ((tmask*SPREAD(tmask_i,DIM=3,NCOPIES=jpk).NE.0.)) ) 307 303 IF( lk_mpp ) THEN 308 CALL mpp_min( z diag_varmin ) ! min over the global domain309 CALL mpp_max( z diag_varmax ) ! max over the global domain304 CALL mpp_min( zmin ) ! min over the global domain 305 CALL mpp_max( zmax ) ! max over the global domain 310 306 END IF 311 zdiag_tot = zdiag_tot + zdiag_var 312 zdiag_var = zdiag_var / areatot 313 IF(lwp) WRITE(numout,*) ' MEAN NO ', jn, ctrcnm(jn), ' = ', zdiag_var, & 314 & ' MIN = ', zdiag_varmin, ' MAX = ', zdiag_varmax 315 END DO 316 317 zder = ( ( zdiag_tot - trai ) / ( trai + 1.e-12 ) ) * 100._wp 318 IF(lwp) WRITE(numout,*) ' Integral of all tracers over the full domain = ', zdiag_tot 319 IF(lwp) WRITE(numout,*) ' Drift of the sum of all tracers =', zder, ' %' 307 zmean = ztraf / areatot 308 zdrift = ( ( ztraf - trai(jn) ) / ( trai(jn) + 1.e-12 ) ) * 100._wp 309 IF(lwp) WRITE(numout,*) ' tracer nb : ', jn,' ', TRIM( ctrcnm(jn) ) , & 310 & ' mean = ', zmean, ' min = ', zmin, ' max = ', zmax, ' drift = ', zdrift, ' %' 311 END DO 312 WRITE(numout,*) 320 313 321 314 END SUBROUTINE trc_rst_stat -
branches/2011/dev_r2787_LOCEAN3_TRA_TRP/NEMOGCM/NEMO/TOP_SRC/trcsms.F90
r2715 r2819 47 47 !!--------------------------------------------------------------------- 48 48 49 IF ( MOD( kt, nn_dttrc) /= 0 ) RETURN ! this ROUTINE is called only every ndttrc time step50 51 49 IF( lk_lobster ) CALL trc_sms_lobster( kt ) ! main program of LOBSTER 52 50 IF( lk_pisces ) CALL trc_sms_pisces ( kt ) ! main program of PISCES -
branches/2011/dev_r2787_LOCEAN3_TRA_TRP/NEMOGCM/NEMO/TOP_SRC/trcstp.F90
r2528 r2819 49 49 !!------------------------------------------------------------------- 50 50 51 IF( kt == nit000 ) THEN 52 CALL iom_close( numrtr ) ! close input passive tracers restart file 53 IF( lk_trdmld_trc ) CALL trd_mld_trc_init ! trends: Mixed-layer 54 ENDIF 55 ! 51 56 IF( MOD( kt - 1 , nn_dttrc ) == 0 ) THEN ! only every nn_dttrc time step 52 57 ! … … 58 63 tra(:,:,:,:) = 0.e0 59 64 ! 60 IF( kt == nit000 .AND. lk_trdmld_trc ) &61 & CALL trd_mld_trc_init ! trends: Mixed-layer62 65 CALL trc_rst_opn( kt ) ! Open tracer restart file 63 IF( lk_iomput ) THEN ; CALL trc_wri ( kt ) ! output of passive tracers64 ELSE ; CALL trc_dia ( kt )66 IF( lk_iomput ) THEN ; CALL trc_wri ( kt ) ! output of passive tracers with iom I/O manager 67 ELSE ; CALL trc_dia ( kt ) ! output of passive tracers with old I/O manager 65 68 ENDIF 66 CALL trc_sms( kt ) ! tracers: sink and source 67 CALL trc_trp( kt ) ! transport of passive tracers 68 IF( kt == nit000 ) CALL iom_close( numrtr ) ! close input passive tracers restart file 69 CALL trc_sms ( kt ) ! tracers: sources minus sinks 70 CALL trc_trp ( kt ) ! transport of passive tracers 69 71 IF( lrst_trc ) CALL trc_rst_wri( kt ) ! write tracer restart file 70 72 IF( lk_trdmld_trc ) CALL trd_mld_trc( kt ) ! trends: Mixed-layer -
branches/2011/dev_r2787_LOCEAN3_TRA_TRP/NEMOGCM/NEMO/TOP_SRC/trcwri.F90
r2567 r2819 1 1 MODULE trcwri 2 !!====================================================================== =============2 !!====================================================================== 3 3 !! *** MODULE trcwri *** 4 4 !! TOP : Output of passive tracers 5 !!====================================================================== ==============5 !!====================================================================== 6 6 !! History : 1.0 ! 2009-05 (C. Ethe) Original code 7 7 !!---------------------------------------------------------------------- 8 #if defined key_top && 8 #if defined key_top && defined key_iomput 9 9 !!---------------------------------------------------------------------- 10 !! 'key_top' && 'key_iomput'TOP models10 !! 'key_top' TOP models 11 11 !!---------------------------------------------------------------------- 12 12 !! trc_wri_trc : outputs of concentration fields 13 13 !!---------------------------------------------------------------------- 14 USE dom_oce 15 USE oce_trc 16 USE trc 17 USE iom 18 USE dianam 14 USE dom_oce ! ocean space and time domain variables 15 USE oce_trc ! shared variables between ocean and passive tracers 16 USE trc ! passive tracers common variables 17 USE iom ! I/O manager 18 USE dianam ! Output file name 19 19 20 20 IMPLICIT NONE … … 50 50 !! ** Purpose : output passive tracers fields 51 51 !!--------------------------------------------------------------------- 52 INTEGER, INTENT( in ) :: kt ! ocean time-step53 INTEGER :: jn54 CHARACTER (len=20) :: cltra55 CHARACTER (len=40) :: clhstnam52 INTEGER, INTENT( in ) :: kt ! ocean time-step 53 INTEGER :: jn 54 CHARACTER (len=20) :: cltra 55 CHARACTER (len=40) :: clhstnam 56 56 INTEGER :: inum = 11 ! temporary logical unit 57 57 !!--------------------------------------------------------------------- -
branches/2011/dev_r2787_LOCEAN3_TRA_TRP/NEMOGCM/TOOLS/COMPILE/cfg.txt
r2413 r2819 6 6 ORCA2_LIM3 OPA_SRC LIM_SRC_3 7 7 ORCA2_LIM OPA_SRC LIM_SRC_2 NST_SRC 8 ORCA2_LIM_CFC OPA_SRC LIM_SRC_2 NST_SRC TOP_SRC 9 ORCA2_OFF_CFC OPA_SRC OFF_SRC TOP_SRC
Note: See TracChangeset
for help on using the changeset viewer.