[4015] | 1 | MODULE crs |
---|
| 2 | !!====================================================================== |
---|
| 3 | !! *** MODULE crs_dom *** |
---|
| 4 | !! Declare the coarse grid domain and other public variables |
---|
| 5 | !! then allocate them if needed. |
---|
| 6 | !!====================================================================== |
---|
| 7 | !! History 2012-06 Editing (J. Simeon, G. Madec, C. Ethe, C. Calone) Original code |
---|
| 8 | !!---------------------------------------------------------------------- |
---|
| 9 | USE par_oce |
---|
| 10 | USE dom_oce |
---|
| 11 | USE in_out_manager |
---|
[5010] | 12 | USE lbcnfd |
---|
[4015] | 13 | |
---|
| 14 | IMPLICIT NONE |
---|
| 15 | PUBLIC |
---|
| 16 | |
---|
| 17 | |
---|
| 18 | PUBLIC crs_dom_alloc ! Called from crsini.F90 |
---|
| 19 | PUBLIC dom_grid_glo |
---|
| 20 | PUBLIC dom_grid_crs |
---|
| 21 | |
---|
| 22 | ! Domain variables |
---|
| 23 | INTEGER :: jpiglo_crs , & !: 1st dimension of global coarse grid domain |
---|
| 24 | jpjglo_crs !: 2nd dimension of global coarse grid domain |
---|
| 25 | INTEGER :: jpi_crs , & !: 1st dimension of local coarse grid domain |
---|
| 26 | jpj_crs !: 2nd dimension of local coarse grid domain |
---|
| 27 | INTEGER :: jpi_full , & !: 1st dimension of local parent grid domain |
---|
| 28 | jpj_full !: 2nd dimension of local parent grid domain |
---|
| 29 | |
---|
| 30 | INTEGER :: nistr , njstr |
---|
| 31 | INTEGER :: niend , njend |
---|
| 32 | |
---|
| 33 | INTEGER :: jpi_crsm1, jpj_crsm1 !: loop indices |
---|
| 34 | INTEGER :: jpiglo_crsm1, jpjglo_crsm1 !: loop indices |
---|
| 35 | INTEGER :: npolj_full, npolj_crs !: north fold mark |
---|
| 36 | INTEGER :: jpiglo_full, jpjglo_full !: jpiglo / jpjglo |
---|
| 37 | INTEGER :: npiglo, npjglo !: jpjglo |
---|
| 38 | INTEGER :: nlci_full, nlcj_full !: i-, j-dimension of local or sub domain on parent grid |
---|
| 39 | INTEGER :: nldi_full, nldj_full !: starting indices of internal sub-domain on parent grid |
---|
| 40 | INTEGER :: nlei_full, nlej_full !: ending indices of internal sub-domain on parent grid |
---|
| 41 | INTEGER :: nlci_crs, nlcj_crs !: i-, j-dimension of local or sub domain on coarse grid |
---|
| 42 | INTEGER :: nldi_crs, nldj_crs !: starting indices of internal sub-domain on coarse grid |
---|
| 43 | INTEGER :: nlei_crs, nlej_crs !: ending indices of internal sub-domain on coarse grid |
---|
[4064] | 44 | |
---|
[4015] | 45 | INTEGER :: narea_full, narea_crs !: node |
---|
| 46 | INTEGER :: jpnij_full, jpnij_crs !: =jpni*jpnj, the pe decomposition |
---|
| 47 | INTEGER :: jpim1_full, jpjm1_full !: |
---|
| 48 | INTEGER :: nimpp_full, njmpp_full !: global position of point (1,1) of subdomain on parent grid |
---|
| 49 | INTEGER :: nimpp_crs, njmpp_crs !: set to 1,1 for now . Valid only for monoproc |
---|
| 50 | INTEGER :: nreci_full, nrecj_full |
---|
| 51 | INTEGER :: nreci_crs, nrecj_crs |
---|
| 52 | !cc |
---|
| 53 | INTEGER :: noea_full, nowe_full !: index of the local neighboring processors in |
---|
| 54 | INTEGER :: noso_full, nono_full !: east, west, south and north directions |
---|
| 55 | INTEGER :: npne_full, npnw_full !: index of north east and north west processor |
---|
| 56 | INTEGER :: npse_full, npsw_full !: index of south east and south west processor |
---|
| 57 | INTEGER :: nbne_full, nbnw_full !: logical of north east & north west processor |
---|
| 58 | INTEGER :: nbse_full, nbsw_full !: logical of south east & south west processor |
---|
| 59 | INTEGER :: nidom_full !: ??? |
---|
| 60 | INTEGER :: nproc_full !:number for local processor |
---|
| 61 | INTEGER :: nbondi_full, nbondj_full !: mark of i- and j-direction local boundaries |
---|
| 62 | INTEGER :: noea_crs, nowe_crs !: index of the local neighboring processors in |
---|
| 63 | INTEGER :: noso_crs, nono_crs !: east, west, south and north directions |
---|
| 64 | INTEGER :: npne_crs, npnw_crs !: index of north east and north west processor |
---|
| 65 | INTEGER :: npse_crs, npsw_crs !: index of south east and south west processor |
---|
| 66 | INTEGER :: nbne_crs, nbnw_crs !: logical of north east & north west processor |
---|
| 67 | INTEGER :: nbse_crs, nbsw_crs !: logical of south east & south west processor |
---|
| 68 | INTEGER :: nidom_crs !: ??? |
---|
| 69 | INTEGER :: nproc_crs !:number for local processor |
---|
| 70 | INTEGER :: nbondi_crs, nbondj_crs !: mark of i- and j-direction local boundaries |
---|
[5010] | 71 | |
---|
| 72 | INTEGER :: nfsloop_full,nfeloop_full |
---|
| 73 | INTEGER :: nfsloop_crs ,nfeloop_crs |
---|
[4015] | 74 | |
---|
| 75 | INTEGER, DIMENSION(:), ALLOCATABLE :: mis_crs, mie_crs, mis2_crs, mie2_crs ! starting and ending i-indices of parent subset |
---|
[7398] | 76 | INTEGER, DIMENSION(:), ALLOCATABLE :: mjs_crs, mje_crs, mjs2_crs, mje2_crs ! starting and ending j-indices of parent subset |
---|
[4015] | 77 | INTEGER, DIMENSION(:), ALLOCATABLE :: mjg_crs, mig_crs |
---|
[4064] | 78 | INTEGER, DIMENSION(:), ALLOCATABLE :: mi0_crs, mi1_crs, mj0_crs, mj1_crs |
---|
[7398] | 79 | INTEGER :: mxbinctr, mybinctr ! central point in grid box |
---|
| 80 | INTEGER, DIMENSION(:), ALLOCATABLE :: nlcit_crs, nlcit_full ! dimensions of every subdomain |
---|
| 81 | INTEGER, DIMENSION(:), ALLOCATABLE :: nldit_crs, nldit_full ! first, last indoor index for each i-domain |
---|
| 82 | INTEGER, DIMENSION(:), ALLOCATABLE :: nleit_crs, nleit_full ! first, last indoor index for each j-domain |
---|
| 83 | INTEGER, DIMENSION(:), ALLOCATABLE :: nimppt_crs, nimppt_full ! first, last indoor index for each j-domain |
---|
| 84 | INTEGER, DIMENSION(:), ALLOCATABLE :: nlcjt_crs, nlcjt_full ! dimensions of every subdomain |
---|
| 85 | INTEGER, DIMENSION(:), ALLOCATABLE :: nldjt_crs, nldjt_full ! first, last indoor index for each i-domain |
---|
| 86 | INTEGER, DIMENSION(:), ALLOCATABLE :: nlejt_crs, nlejt_full ! first, last indoor index for each j-domain |
---|
| 87 | INTEGER, DIMENSION(:), ALLOCATABLE :: njmppt_crs, njmppt_full ! first, last indoor index for each j-domain |
---|
[4015] | 88 | |
---|
[5010] | 89 | INTEGER, DIMENSION(:,:), ALLOCATABLE :: nfiimpp_full |
---|
| 90 | INTEGER, DIMENSION(:,:), ALLOCATABLE :: nfiimpp_crs |
---|
[4015] | 91 | |
---|
| 92 | ! Masks |
---|
[5105] | 93 | REAL(wp), DIMENSION(:,:,:), ALLOCATABLE,SAVE :: tmask_crs, umask_crs, vmask_crs, fmask_crs |
---|
| 94 | REAL(wp), DIMENSION(:,:) , ALLOCATABLE,SAVE :: tmask_i_crs, rnfmsk_crs, tpol_crs, fpol_crs |
---|
[4015] | 95 | |
---|
| 96 | ! Scale factors |
---|
| 97 | REAL(wp), DIMENSION(:,:), ALLOCATABLE :: e1t_crs, e2t_crs, e1e2t_crs ! horizontal scale factors grid type T |
---|
[7398] | 98 | REAL(wp), DIMENSION(:,:), ALLOCATABLE :: e1u_crs, e2u_crs ! horizontal scale factors grid type U |
---|
| 99 | REAL(wp), DIMENSION(:,:), ALLOCATABLE :: e1v_crs, e2v_crs ! horizontal scale factors grid type V |
---|
| 100 | REAL(wp), DIMENSION(:,:), ALLOCATABLE :: e1f_crs, e2f_crs ! horizontal scale factors grid type F |
---|
[6772] | 101 | |
---|
[7398] | 102 | REAL(wp), DIMENSION(:,:) , ALLOCATABLE :: ht_0_crs |
---|
[6772] | 103 | REAL(wp), DIMENSION(:,:,:), ALLOCATABLE :: e3t_0_crs, e3u_0_crs, e3v_0_crs, e3f_0_crs, e3w_0_crs |
---|
| 104 | REAL(wp), DIMENSION(:,:,:), ALLOCATABLE :: e3t_max_0_crs, e3u_max_0_crs, e3v_max_0_crs, e3f_max_0_crs, e3w_max_0_crs |
---|
| 105 | |
---|
| 106 | #if defined key_vvl |
---|
| 107 | REAL(wp), DIMENSION(:,:,:), ALLOCATABLE :: e3t_b_crs, e3u_b_crs, e3v_b_crs, e3f_b_crs, e3w_b_crs |
---|
| 108 | REAL(wp), DIMENSION(:,:,:), ALLOCATABLE :: e3t_n_crs, e3u_n_crs, e3v_n_crs, e3f_n_crs, e3w_n_crs |
---|
| 109 | REAL(wp), DIMENSION(:,:,:), ALLOCATABLE :: e3t_a_crs, e3u_a_crs, e3v_a_crs, e3f_a_crs, e3w_a_crs |
---|
| 110 | REAL(wp), DIMENSION(:,:,:), ALLOCATABLE :: e3t_max_n_crs, e3u_max_n_crs, e3v_max_n_crs, e3f_max_n_crs, e3w_max_n_crs |
---|
| 111 | #endif |
---|
| 112 | |
---|
[4015] | 113 | ! Surface |
---|
| 114 | REAL(wp), DIMENSION(:,:,:), ALLOCATABLE :: e1e2w_crs, e2e3u_crs, e1e3v_crs |
---|
| 115 | REAL(wp), DIMENSION(:,:,:), ALLOCATABLE :: e1e2w_msk, e2e3u_msk, e1e3v_msk |
---|
[7398] | 116 | |
---|
[4015] | 117 | ! Coordinates |
---|
[5105] | 118 | REAL(wp), DIMENSION(:,:), ALLOCATABLE,SAVE :: gphit_crs, glamt_crs, gphif_crs, glamf_crs |
---|
| 119 | REAL(wp), DIMENSION(:,:), ALLOCATABLE,SAVE :: gphiu_crs, glamu_crs, gphiv_crs, glamv_crs |
---|
| 120 | REAL(wp), DIMENSION(:,:), ALLOCATABLE,SAVE :: ff_crs |
---|
| 121 | INTEGER, DIMENSION(:,:), ALLOCATABLE,SAVE :: mbathy_crs, mbkt_crs, mbku_crs, mbkv_crs |
---|
[4015] | 122 | |
---|
[6772] | 123 | REAL(wp), DIMENSION(:,:,:), ALLOCATABLE,SAVE :: gdept_0_crs, gdepu_0_crs, gdepv_0_crs, gdepw_0_crs |
---|
| 124 | #if defined key_vvl |
---|
| 125 | REAL(wp), DIMENSION(:,:,:), ALLOCATABLE,SAVE :: gdept_n_crs, gdepu_n_crs, gdepv_n_crs, gdepw_n_crs |
---|
| 126 | #endif |
---|
| 127 | |
---|
[4015] | 128 | ! Weights |
---|
| 129 | REAL(wp), DIMENSION(:,:,:), ALLOCATABLE :: facsurfv, facsurfu, facvol_t, facvol_w |
---|
| 130 | REAL(wp), DIMENSION(:,:,:), ALLOCATABLE :: ocean_volume_crs_t, ocean_volume_crs_w, bt_crs, r1_bt_crs |
---|
| 131 | REAL(wp), DIMENSION(:,:,:), ALLOCATABLE :: crs_surfu_wgt, crs_surfv_wgt, crs_surfw_wgt, crs_volt_wgt |
---|
| 132 | |
---|
[7398] | 133 | ! Namelist |
---|
[4015] | 134 | INTEGER :: nn_factx = 3 !: reduction factor of x-dimension of the parent grid |
---|
| 135 | INTEGER :: nn_facty = 3 !: reduction factor of y-dimension of the parent grid |
---|
| 136 | INTEGER :: nn_msh_crs = 1 !: Organization of mesh mask output |
---|
| 137 | !: 0 = no mesh mask output |
---|
| 138 | !: 1 = unified mesh mask output |
---|
| 139 | !: 2 = 2 separate mesh mask output |
---|
| 140 | !: 3 = 3 separate mesh mask output |
---|
| 141 | INTEGER :: nn_crs_kz = 0 !: type of Kz coarsening ( =0->VOL ; =1->MAX ; =2->MIN) |
---|
| 142 | LOGICAL :: ln_crs_wn = .FALSE. !: coarsening wn or computation using horizontal divergence |
---|
[7398] | 143 | LOGICAL, PUBLIC :: ln_crs_top = .FALSE. !:coarsening online for the bio |
---|
[4015] | 144 | ! |
---|
| 145 | |
---|
| 146 | ! Grid reduction factors |
---|
| 147 | REAL(wp) :: rfactx_r !: inverse of x-dim reduction factor |
---|
| 148 | REAL(wp) :: rfacty_r !: inverse of y-dim reduction factor |
---|
| 149 | REAL(wp) :: rfactxy |
---|
[7398] | 150 | INTEGER :: nrestx, nresty !: for determining odd or even reduction factor |
---|
| 151 | INTEGER, DIMENSION(:), ALLOCATABLE :: nfactx,nfacty |
---|
[4015] | 152 | |
---|
[6772] | 153 | |
---|
[4015] | 154 | ! Physical and dynamical ocean fields for output or passing to TOP, time-mean fields |
---|
[6772] | 155 | REAL(wp), DIMENSION(:,:,:,:), ALLOCATABLE :: tsb_crs,tsn_crs,tsa_crs,rab_crs_n |
---|
[7795] | 156 | REAL(wp), DIMENSION(:,:,:) , ALLOCATABLE :: un_crs, vn_crs, wn_crs |
---|
[5105] | 157 | REAL(wp), DIMENSION(:,:,:) , ALLOCATABLE :: ub_crs, vb_crs |
---|
| 158 | REAL(wp), DIMENSION(:,:,:) , ALLOCATABLE :: hdivb_crs , hdivn_crs |
---|
| 159 | REAL(wp), DIMENSION(:,:) , ALLOCATABLE :: sshb_crs, sshn_crs , ssha_crs |
---|
[6101] | 160 | REAL(wp), DIMENSION(:,:,:) , ALLOCATABLE :: rhop_crs,rhd_crs,rn2_crs,rb2_crs |
---|
[5105] | 161 | REAL(wp), DIMENSION(:,:) , ALLOCATABLE :: gru_crs, grv_crs |
---|
| 162 | REAL(wp), DIMENSION(:,:,:) , ALLOCATABLE :: gtsu_crs, gtsv_crs |
---|
[4015] | 163 | ! |
---|
| 164 | ! Surface fluxes to pass to TOP |
---|
[7215] | 165 | REAL(wp), PUBLIC, DIMENSION(:,:) , ALLOCATABLE :: qsr_crs, fr_i_crs, wndm_crs |
---|
[4064] | 166 | REAL(wp), PUBLIC, DIMENSION(:,:) , ALLOCATABLE :: emp_crs, emp_b_crs, sfx_crs |
---|
[5105] | 167 | REAL(wp), PUBLIC, DIMENSION(:,:) , ALLOCATABLE :: fmmflx_crs |
---|
[6101] | 168 | REAL(wp), PUBLIC, DIMENSION(:,:) , ALLOCATABLE :: utau_crs, vtau_crs, taum_crs |
---|
[7398] | 169 | REAL(wp), PUBLIC, DIMENSION(:,:) , ALLOCATABLE :: rnf_crs,rnf_b_crs,h_rnf_crs |
---|
| 170 | INTEGER , PUBLIC, DIMENSION(:,:) , ALLOCATABLE :: nk_rnf_crs |
---|
[6772] | 171 | REAL(wp), PUBLIC, DIMENSION(:,:,:), ALLOCATABLE :: trc_i_crs,trc_o_crs |
---|
[7215] | 172 | REAL(wp), PUBLIC, DIMENSION(:,:,:), ALLOCATABLE :: sbc_trc_crs, sbc_trc_b_crs |
---|
[4015] | 173 | |
---|
[7398] | 174 | REAL(wp), PUBLIC, DIMENSION(:,:,:), ALLOCATABLE :: uslp_crs, wslpi_crs !: i_slope at U- and W-points |
---|
| 175 | REAL(wp), PUBLIC, DIMENSION(:,:,:), ALLOCATABLE :: vslp_crs, wslpj_crs !: j-slope at V- and W-points |
---|
[5601] | 176 | |
---|
| 177 | ! Horizontal diffusion |
---|
| 178 | #if defined key_traldf_c3d |
---|
[7256] | 179 | REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: ahtt_crs, ahtu_crs, ahtv_crs, ahtw_crs !: ** 3D coefficients ** at T-,U-,V-,W-points |
---|
[5601] | 180 | #elif defined key_traldf_c2d |
---|
[7256] | 181 | REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: ahtt_crs, ahtu_crs, ahtv_crs, ahtw_crs !: ** 2D coefficients ** at T-,U-,V-,W-points |
---|
[5601] | 182 | #elif defined key_traldf_c1d |
---|
[7256] | 183 | REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:) :: ahtt_crs, ahtu_crs, ahtv_crs, ahtw_crs !: ** 1D coefficients ** at T-,U-,V-,W-points |
---|
[5601] | 184 | #else |
---|
[7256] | 185 | REAL(wp), PUBLIC :: ahtt_crs, ahtu_crs, ahtv_crs, ahtw_crs !: ** 0D coefficients ** at T-,U-,V-,W-points |
---|
[5601] | 186 | #endif |
---|
[7256] | 187 | REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: r_fact_lap_crs |
---|
[5601] | 188 | |
---|
[4015] | 189 | ! Vertical diffusion |
---|
| 190 | REAL(wp), PUBLIC, ALLOCATABLE, DIMENSION(:,:,:) :: avt_crs !: vert. diffusivity coef. [m2/s] at w-point for temp |
---|
[6101] | 191 | REAL(wp), PUBLIC, ALLOCATABLE, DIMENSION(:,:,:) :: en_crs !: vert. diffusivity coef. [m2/s] at w-point for temp |
---|
| 192 | REAL(wp), PUBLIC, ALLOCATABLE, DIMENSION(:,:) :: avtb_2d_crs !: vert. diffusivity coef. [m2/s] at w-point for temp |
---|
[4015] | 193 | # if defined key_zdfddm |
---|
| 194 | REAL(wp), PUBLIC, ALLOCATABLE, DIMENSION(:,:,:) :: avs_crs !: salinity vertical diffusivity coeff. [m2/s] at w-point |
---|
| 195 | # endif |
---|
| 196 | |
---|
| 197 | ! Mixing and Mixed Layer Depth |
---|
[5105] | 198 | INTEGER, PUBLIC, DIMENSION(:,:) , ALLOCATABLE :: nmln_crs |
---|
| 199 | REAL(wp), PUBLIC, DIMENSION(:,:) , ALLOCATABLE :: hmlp_crs , hmlpt_crs , hmld_crs |
---|
[4015] | 200 | |
---|
| 201 | ! Direction of lateral diffusion |
---|
| 202 | |
---|
| 203 | |
---|
[5602] | 204 | !! $Id$ |
---|
[4015] | 205 | CONTAINS |
---|
| 206 | |
---|
[6772] | 207 | INTEGER FUNCTION crs_dom_alloc() |
---|
[4015] | 208 | !!------------------------------------------------------------------- |
---|
| 209 | !! *** FUNCTION crs_dom_alloc *** |
---|
| 210 | !! ** Purpose : Allocate public crs arrays |
---|
| 211 | !!------------------------------------------------------------------- |
---|
| 212 | !! Local variables |
---|
[5601] | 213 | INTEGER, DIMENSION(15) :: ierr |
---|
[4015] | 214 | |
---|
| 215 | ierr(:) = 0 |
---|
| 216 | |
---|
| 217 | ! Set up bins for coarse grid, horizontal only. |
---|
[4064] | 218 | ALLOCATE( mis2_crs(jpiglo_crs), mie2_crs(jpiglo_crs), & |
---|
| 219 | & mjs2_crs(jpjglo_crs), mje2_crs(jpjglo_crs), & |
---|
| 220 | & mi0_crs (jpiglo_crs), mi1_crs (jpiglo_crs), & |
---|
| 221 | & mj0_crs (jpjglo_crs), mj1_crs (jpjglo_crs), & |
---|
[6772] | 222 | & mig_crs (jpi_crs) , mjg_crs (jpj_crs) , & |
---|
| 223 | & mis_crs (jpi_crs) , mie_crs (jpi_crs) , & |
---|
| 224 | & mjs_crs (jpj_crs) , mje_crs (jpj_crs) , & |
---|
| 225 | & nfactx (jpi_crs) , nfacty (jpj_crs) , & |
---|
| 226 | & nimppt_crs(jpnij) , nlcit_crs(jpnij) , nldit_crs(jpnij) , nleit_crs(jpnij) , & |
---|
| 227 | & nimppt_full(jpnij), nlcit_full(jpnij), nldit_full(jpnij), nleit_full(jpnij), & |
---|
| 228 | & njmppt_crs(jpnij) , nlcjt_crs(jpnij) , nldjt_crs(jpnij) , nlejt_crs(jpnij) , & |
---|
| 229 | & njmppt_full(jpnij), nlcjt_full(jpnij), nldjt_full(jpnij), nlejt_full(jpnij), & |
---|
| 230 | & nfiimpp_full(jpni,jpnj) , nfiimpp_crs(jpni,jpnj) , STAT=ierr(1) ) |
---|
[4015] | 231 | |
---|
| 232 | ! Set up Mask and Mesh |
---|
| 233 | ALLOCATE( tmask_crs(jpi_crs,jpj_crs,jpk) , fmask_crs(jpi_crs,jpj_crs,jpk) , & |
---|
| 234 | & umask_crs(jpi_crs,jpj_crs,jpk) , vmask_crs(jpi_crs,jpj_crs,jpk) , STAT=ierr(2)) |
---|
| 235 | |
---|
[4064] | 236 | ALLOCATE( tmask_i_crs(jpi_crs,jpj_crs) , rnfmsk_crs(jpi_crs,jpj_crs), & |
---|
| 237 | & tpol_crs(jpiglo_crs,jpjglo_crs), fpol_crs(jpiglo_crs,jpjglo_crs), STAT=ierr(3) ) |
---|
[4015] | 238 | |
---|
| 239 | ALLOCATE( gphit_crs(jpi_crs,jpj_crs) , glamt_crs(jpi_crs,jpj_crs) , & |
---|
| 240 | & gphiu_crs(jpi_crs,jpj_crs) , glamu_crs(jpi_crs,jpj_crs) , & |
---|
| 241 | & gphiv_crs(jpi_crs,jpj_crs) , glamv_crs(jpi_crs,jpj_crs) , & |
---|
| 242 | & gphif_crs(jpi_crs,jpj_crs) , glamf_crs(jpi_crs,jpj_crs) , & |
---|
| 243 | & ff_crs(jpi_crs,jpj_crs) , STAT=ierr(4)) |
---|
| 244 | |
---|
| 245 | ALLOCATE( e1t_crs(jpi_crs,jpj_crs) , e2t_crs(jpi_crs,jpj_crs) , & |
---|
| 246 | & e1u_crs(jpi_crs,jpj_crs) , e2u_crs(jpi_crs,jpj_crs) , & |
---|
| 247 | & e1v_crs(jpi_crs,jpj_crs) , e2v_crs(jpi_crs,jpj_crs) , & |
---|
| 248 | & e1f_crs(jpi_crs,jpj_crs) , e2f_crs(jpi_crs,jpj_crs) , & |
---|
| 249 | & e1e2t_crs(jpi_crs,jpj_crs), STAT=ierr(5)) |
---|
| 250 | |
---|
[6772] | 251 | ALLOCATE( e3t_0_crs(jpi_crs,jpj_crs,jpk) , e3w_0_crs(jpi_crs,jpj_crs,jpk) , & |
---|
| 252 | & e3u_0_crs(jpi_crs,jpj_crs,jpk) , e3v_0_crs(jpi_crs,jpj_crs,jpk) , & |
---|
| 253 | & ht_0_crs(jpi_crs,jpj_crs), & |
---|
| 254 | #if defined key_vvl |
---|
| 255 | & e3t_b_crs(jpi_crs,jpj_crs,jpk) , e3w_b_crs(jpi_crs,jpj_crs,jpk) , & |
---|
| 256 | & e3u_b_crs(jpi_crs,jpj_crs,jpk) , e3v_b_crs(jpi_crs,jpj_crs,jpk) , & |
---|
| 257 | & e3t_n_crs(jpi_crs,jpj_crs,jpk) , e3w_n_crs(jpi_crs,jpj_crs,jpk) , & |
---|
| 258 | & e3u_n_crs(jpi_crs,jpj_crs,jpk) , e3v_n_crs(jpi_crs,jpj_crs,jpk) , & |
---|
| 259 | & e3t_a_crs(jpi_crs,jpj_crs,jpk) , e3w_a_crs(jpi_crs,jpj_crs,jpk) , & |
---|
| 260 | & e3u_a_crs(jpi_crs,jpj_crs,jpk) , e3v_a_crs(jpi_crs,jpj_crs,jpk) , & |
---|
| 261 | #endif |
---|
| 262 | & e1e2w_msk(jpi_crs,jpj_crs,jpk) , & |
---|
[4064] | 263 | & e2e3u_msk(jpi_crs,jpj_crs,jpk) , e1e3v_msk(jpi_crs,jpj_crs,jpk) , & |
---|
| 264 | & e1e2w_crs(jpi_crs,jpj_crs,jpk) , e2e3u_crs(jpi_crs,jpj_crs,jpk) , & |
---|
[6772] | 265 | & e1e3v_crs(jpi_crs,jpj_crs,jpk) , & |
---|
| 266 | & e3t_max_0_crs(jpi_crs,jpj_crs,jpk), e3w_max_0_crs(jpi_crs,jpj_crs,jpk) , & |
---|
| 267 | & e3u_max_0_crs(jpi_crs,jpj_crs,jpk), e3v_max_0_crs(jpi_crs,jpj_crs,jpk) , & |
---|
| 268 | #if defined key_vvl |
---|
| 269 | & e3t_max_n_crs(jpi_crs,jpj_crs,jpk), e3w_max_n_crs(jpi_crs,jpj_crs,jpk) , & |
---|
| 270 | & e3u_max_n_crs(jpi_crs,jpj_crs,jpk), e3v_max_n_crs(jpi_crs,jpj_crs,jpk) , & |
---|
| 271 | #endif |
---|
| 272 | & STAT=ierr(6)) |
---|
[4015] | 273 | |
---|
| 274 | |
---|
[4064] | 275 | ALLOCATE( facsurfv(jpi_crs,jpj_crs,jpk), facsurfu(jpi_crs,jpj_crs,jpk) , & |
---|
| 276 | & facvol_t(jpi_crs,jpj_crs,jpk), facvol_w(jpi_crs,jpj_crs,jpk) , & |
---|
| 277 | & ocean_volume_crs_t(jpi_crs,jpj_crs,jpk), ocean_volume_crs_w(jpi_crs,jpj_crs,jpk), & |
---|
| 278 | & bt_crs(jpi_crs,jpj_crs,jpk) , r1_bt_crs(jpi_crs,jpj_crs,jpk) , STAT=ierr(7)) |
---|
[4015] | 279 | |
---|
| 280 | |
---|
[4064] | 281 | ALLOCATE( crs_surfu_wgt(jpi_crs,jpj_crs,jpk), crs_surfv_wgt(jpi_crs,jpj_crs,jpk) , & |
---|
| 282 | & crs_surfw_wgt(jpi_crs,jpj_crs,jpk), crs_volt_wgt(jpi_crs,jpj_crs,jpk) , STAT=ierr(8)) |
---|
[4015] | 283 | |
---|
| 284 | |
---|
[4064] | 285 | ALLOCATE( mbathy_crs(jpi_crs,jpj_crs), mbkt_crs(jpi_crs,jpj_crs) , & |
---|
| 286 | & mbku_crs(jpi_crs,jpj_crs) , mbkv_crs(jpi_crs,jpj_crs) , STAT=ierr(9)) |
---|
[4015] | 287 | |
---|
[6772] | 288 | ALLOCATE( gdept_0_crs(jpi_crs,jpj_crs,jpk), gdepu_0_crs(jpi_crs,jpj_crs,jpk) , & |
---|
| 289 | & gdepv_0_crs(jpi_crs,jpj_crs,jpk), gdepw_0_crs(jpi_crs,jpj_crs,jpk) , & |
---|
| 290 | #if defined key_vvl |
---|
| 291 | & gdept_n_crs(jpi_crs,jpj_crs,jpk), gdepu_n_crs(jpi_crs,jpj_crs,jpk) , & |
---|
| 292 | & gdepv_n_crs(jpi_crs,jpj_crs,jpk), gdepw_n_crs(jpi_crs,jpj_crs,jpk) , & |
---|
| 293 | #endif |
---|
| 294 | & STAT=ierr(10)) |
---|
[4015] | 295 | |
---|
| 296 | |
---|
[5105] | 297 | ALLOCATE( ub_crs(jpi_crs,jpj_crs,jpk) , vb_crs(jpi_crs,jpj_crs,jpk) , & |
---|
[7795] | 298 | & un_crs(jpi_crs,jpj_crs,jpk) , vn_crs(jpi_crs,jpj_crs,jpk) , wn_crs(jpi_crs,jpj_crs,jpk) ,& |
---|
[5105] | 299 | & hdivb_crs(jpi_crs,jpj_crs,jpk) , hdivn_crs(jpi_crs,jpj_crs,jpk) , & |
---|
[7795] | 300 | & rhop_crs(jpi_crs,jpj_crs,jpk) , & |
---|
[6101] | 301 | & rb2_crs(jpi_crs,jpj_crs,jpk) ,rn2_crs(jpi_crs,jpj_crs,jpk) , & |
---|
| 302 | & rhd_crs(jpi_crs,jpj_crs,jpk) , rab_crs_n(jpi_crs,jpj_crs,jpk,jpts) , & |
---|
| 303 | & avtb_2d_crs(jpi_crs,jpj_crs), & |
---|
[5601] | 304 | & gtsu_crs(jpi_crs,jpj_crs,jpts) ,gtsv_crs(jpi_crs,jpj_crs,jpts) , & |
---|
[5105] | 305 | gru_crs(jpi_crs,jpj_crs) ,grv_crs(jpi_crs,jpj_crs) , STAT=ierr(11)) |
---|
[4015] | 306 | |
---|
[5105] | 307 | ALLOCATE( sshb_crs(jpi_crs,jpj_crs), sshn_crs(jpi_crs,jpj_crs), ssha_crs(jpi_crs,jpj_crs), & |
---|
[6772] | 308 | & qsr_crs(jpi_crs ,jpj_crs), wndm_crs(jpi_crs,jpj_crs), utau_crs(jpi_crs,jpj_crs) , & |
---|
| 309 | & vtau_crs(jpi_crs,jpj_crs), taum_crs(jpi_crs,jpj_crs), & |
---|
[7398] | 310 | & rnf_crs (jpi_crs,jpj_crs), rnf_b_crs(jpi_crs ,jpj_crs), nk_rnf_crs(jpi_crs ,jpj_crs), h_rnf_crs(jpi_crs ,jpj_crs), & |
---|
[5105] | 311 | & emp_crs (jpi_crs,jpj_crs), emp_b_crs(jpi_crs,jpj_crs), & |
---|
[7215] | 312 | & sbc_trc_crs (jpi_crs,jpj_crs,jpts), sbc_trc_b_crs(jpi_crs,jpj_crs,jpts), & |
---|
| 313 | & trc_i_crs (jpi_crs,jpj_crs,jpts), trc_o_crs(jpi_crs,jpj_crs,jpts), & |
---|
[5105] | 314 | & fr_i_crs(jpi_crs,jpj_crs), sfx_crs(jpi_crs ,jpj_crs), fmmflx_crs(jpi_crs ,jpj_crs), STAT=ierr(12) ) |
---|
[4015] | 315 | |
---|
[5601] | 316 | #if defined key_traldf_c3d |
---|
[6101] | 317 | ALLOCATE( ahtt_crs(jpi_crs,jpj_crs,jpk) , ahtu_crs(jpi_crs,jpj_crs,jpk) , & |
---|
[7256] | 318 | & ahtv_crs(jpi_crs,jpj_crs,jpk) , ahtw_crs(jpi_crs,jpj_crs,jpk) , & |
---|
[5601] | 319 | #elif defined key_traldf_c2d |
---|
[6101] | 320 | ALLOCATE( ahtt_crs(jpi_crs,jpj_crs ) , ahtu_crs(jpi_crs,jpj_crs ) , & |
---|
[7256] | 321 | & ahtv_crs(jpi_crs,jpj_crs ) , ahtw_crs(jpi_crs,jpj_crs ) , & |
---|
[5601] | 322 | #elif defined key_traldf_c1d |
---|
[7256] | 323 | ALLOCATE( ahtt_crs( jpk) , ahtu_crs( jpk) , ahtv_crs( jpk) , ahtw_crs( jpk) , & |
---|
[5601] | 324 | #endif |
---|
[7256] | 325 | & r_fact_lap_crs(jpi_crs,jpj_crs,jpk) , STAT=ierr(13) ) |
---|
[5601] | 326 | |
---|
[6772] | 327 | ALLOCATE( tsb_crs(jpi_crs,jpj_crs,jpk,jpts), tsn_crs(jpi_crs,jpj_crs,jpk,jpts), tsa_crs(jpi_crs,jpj_crs,jpk,jpts), & |
---|
[6101] | 328 | en_crs(jpi_crs,jpj_crs,jpk), avt_crs(jpi_crs,jpj_crs,jpk), & |
---|
[4015] | 329 | # if defined key_zdfddm |
---|
| 330 | & avs_crs(jpi_crs,jpj_crs,jpk), & |
---|
| 331 | # endif |
---|
[5601] | 332 | & STAT=ierr(14) ) |
---|
[4015] | 333 | |
---|
| 334 | ALLOCATE( nmln_crs(jpi_crs,jpj_crs) , hmld_crs(jpi_crs,jpj_crs) , & |
---|
[5601] | 335 | & hmlp_crs(jpi_crs,jpj_crs) , hmlpt_crs(jpi_crs,jpj_crs) , STAT=ierr(15) ) |
---|
[5007] | 336 | |
---|
[4015] | 337 | crs_dom_alloc = MAXVAL(ierr) |
---|
| 338 | |
---|
| 339 | END FUNCTION crs_dom_alloc |
---|
| 340 | |
---|
| 341 | SUBROUTINE dom_grid_glo |
---|
| 342 | !!-------------------------------------------------------------------- |
---|
| 343 | !! *** MODULE dom_grid_glo *** |
---|
| 344 | !! |
---|
| 345 | !! ** Purpose : +Return back to parent grid domain |
---|
| 346 | !!--------------------------------------------------------------------- |
---|
| 347 | |
---|
| 348 | ! Return to parent grid domain |
---|
| 349 | jpi = jpi_full |
---|
| 350 | jpj = jpj_full |
---|
| 351 | jpim1 = jpim1_full |
---|
| 352 | jpjm1 = jpjm1_full |
---|
| 353 | |
---|
| 354 | npolj = npolj_full |
---|
| 355 | jpiglo = jpiglo_full |
---|
| 356 | jpjglo = jpjglo_full |
---|
| 357 | |
---|
| 358 | nlci = nlci_full |
---|
| 359 | nlcj = nlcj_full |
---|
| 360 | nldi = nldi_full |
---|
| 361 | nldj = nldj_full |
---|
| 362 | nlei = nlei_full |
---|
| 363 | nlej = nlej_full |
---|
| 364 | nimpp = nimpp_full |
---|
| 365 | njmpp = njmpp_full |
---|
| 366 | |
---|
| 367 | nlcit(:) = nlcit_full(:) |
---|
| 368 | nldit(:) = nldit_full(:) |
---|
| 369 | nleit(:) = nleit_full(:) |
---|
| 370 | nimppt(:) = nimppt_full(:) |
---|
| 371 | nlcjt(:) = nlcjt_full(:) |
---|
| 372 | nldjt(:) = nldjt_full(:) |
---|
| 373 | nlejt(:) = nlejt_full(:) |
---|
| 374 | njmppt(:) = njmppt_full(:) |
---|
| 375 | |
---|
[5010] | 376 | nfsloop = nfsloop_full |
---|
| 377 | nfeloop = nfeloop_full |
---|
| 378 | |
---|
| 379 | nfiimpp(:,:) = nfiimpp_full(:,:) |
---|
| 380 | |
---|
[4015] | 381 | END SUBROUTINE dom_grid_glo |
---|
| 382 | |
---|
| 383 | SUBROUTINE dom_grid_crs |
---|
| 384 | !!-------------------------------------------------------------------- |
---|
| 385 | !! *** MODULE dom_grid_crs *** |
---|
| 386 | !! |
---|
| 387 | !! ** Purpose : Save the parent grid information & Switch to coarse grid domain |
---|
| 388 | !!--------------------------------------------------------------------- |
---|
| 389 | ! |
---|
| 390 | ! Switch to coarse grid domain |
---|
| 391 | jpi = jpi_crs |
---|
| 392 | jpj = jpj_crs |
---|
| 393 | jpim1 = jpi_crsm1 |
---|
| 394 | jpjm1 = jpj_crsm1 |
---|
| 395 | |
---|
| 396 | npolj = npolj_crs |
---|
| 397 | jpiglo = jpiglo_crs |
---|
| 398 | jpjglo = jpjglo_crs |
---|
| 399 | |
---|
| 400 | |
---|
| 401 | nlci = nlci_crs |
---|
| 402 | nlcj = nlcj_crs |
---|
| 403 | nldi = nldi_crs |
---|
| 404 | nlei = nlei_crs |
---|
| 405 | nlej = nlej_crs |
---|
| 406 | nldj = nldj_crs |
---|
| 407 | nimpp = nimpp_crs |
---|
| 408 | njmpp = njmpp_crs |
---|
| 409 | |
---|
| 410 | nlcit(:) = nlcit_crs(:) |
---|
| 411 | nldit(:) = nldit_crs(:) |
---|
| 412 | nleit(:) = nleit_crs(:) |
---|
| 413 | nimppt(:) = nimppt_crs(:) |
---|
| 414 | nlcjt(:) = nlcjt_crs(:) |
---|
| 415 | nldjt(:) = nldjt_crs(:) |
---|
| 416 | nlejt(:) = nlejt_crs(:) |
---|
| 417 | njmppt(:) = njmppt_crs(:) |
---|
| 418 | |
---|
[5010] | 419 | nfsloop = nfsloop_crs |
---|
| 420 | nfeloop = nfeloop_crs |
---|
[4015] | 421 | |
---|
[5010] | 422 | nfiimpp(:,:) = nfiimpp_crs(:,:) |
---|
| 423 | |
---|
[4015] | 424 | ! |
---|
| 425 | END SUBROUTINE dom_grid_crs |
---|
| 426 | |
---|
| 427 | |
---|
| 428 | !!====================================================================== |
---|
| 429 | |
---|
| 430 | END MODULE crs |
---|
| 431 | |
---|