[782] | 1 | MODULE agrif_oce |
---|
[1605] | 2 | !!====================================================================== |
---|
[782] | 3 | !! *** MODULE agrif_oce *** |
---|
[1605] | 4 | !! AGRIF : define in memory AGRIF variables |
---|
[782] | 5 | !!---------------------------------------------------------------------- |
---|
[1605] | 6 | !! History : 2.0 ! 2007-12 (R. Benshila) Original code |
---|
[782] | 7 | !!---------------------------------------------------------------------- |
---|
[1605] | 8 | #if defined key_agrif |
---|
[782] | 9 | !!---------------------------------------------------------------------- |
---|
[1605] | 10 | !! 'key_agrif' AGRIF zoom |
---|
| 11 | !!---------------------------------------------------------------------- |
---|
[782] | 12 | USE par_oce ! ocean parameters |
---|
| 13 | USE dom_oce ! domain parameters |
---|
[5656] | 14 | |
---|
[782] | 15 | IMPLICIT NONE |
---|
[2715] | 16 | PRIVATE |
---|
[782] | 17 | |
---|
[2715] | 18 | PUBLIC agrif_oce_alloc ! routine called by nemo_init in nemogcm.F90 |
---|
[12377] | 19 | |
---|
[1605] | 20 | ! !!* Namelist namagrif: AGRIF parameters |
---|
[13216] | 21 | LOGICAL , PUBLIC :: ln_init_chfrpar = .FALSE. !: set child grids initial state from parent |
---|
[12377] | 22 | LOGICAL , PUBLIC :: ln_agrif_2way = .TRUE. !: activate two way nesting |
---|
| 23 | LOGICAL , PUBLIC :: ln_spc_dyn = .FALSE. !: use zeros (.false.) or not (.true.) in |
---|
| 24 | !: bdys dynamical fields interpolation |
---|
[14086] | 25 | LOGICAL , PUBLIC :: ln_vert_remap = .FALSE. !: use vertical remapping |
---|
| 26 | REAL(wp), PUBLIC :: rn_sponge_tra = 0.002 !: sponge coeff. for tracers |
---|
| 27 | REAL(wp), PUBLIC :: rn_sponge_dyn = 0.002 !: sponge coeff. for dynamics |
---|
[12377] | 28 | REAL(wp), PUBLIC :: rn_trelax_tra = 0.01 !: time relaxation parameter for tracers |
---|
| 29 | REAL(wp), PUBLIC :: rn_trelax_dyn = 0.01 !: time relaxation parameter for momentum |
---|
[5656] | 30 | LOGICAL , PUBLIC :: ln_chk_bathy = .FALSE. !: check of parent bathymetry |
---|
[12377] | 31 | ! |
---|
| 32 | INTEGER , PUBLIC, PARAMETER :: nn_sponge_len = 2 !: Sponge width (in number of parent grid points) |
---|
[14086] | 33 | INTEGER , PUBLIC, PARAMETER :: nn_shift_bar = 0 !: nb of coarse grid points by which we shift 2d interface |
---|
[13216] | 34 | |
---|
[5656] | 35 | LOGICAL , PUBLIC :: spongedoneT = .FALSE. !: tracer sponge layer indicator |
---|
| 36 | LOGICAL , PUBLIC :: spongedoneU = .FALSE. !: dynamics sponge layer indicator |
---|
| 37 | LOGICAL , PUBLIC :: lk_agrif_fstep = .TRUE. !: if true: first step |
---|
| 38 | LOGICAL , PUBLIC :: lk_agrif_debug = .FALSE. !: if true: print debugging info |
---|
[14086] | 39 | LOGICAL , PUBLIC :: lk_tint2d_notinterp = .FALSE. !: if true, no time interp |
---|
[5656] | 40 | LOGICAL , PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: tabspongedone_tsn |
---|
| 41 | # if defined key_top |
---|
| 42 | LOGICAL , PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: tabspongedone_trn |
---|
| 43 | # endif |
---|
| 44 | LOGICAL , PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: tabspongedone_u |
---|
| 45 | LOGICAL , PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: tabspongedone_v |
---|
[12377] | 46 | INTEGER , PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: utint_stage |
---|
| 47 | INTEGER , PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: vtint_stage |
---|
| 48 | REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: fspu, fspv !: sponge arrays |
---|
| 49 | REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: fspt, fspf !: " " |
---|
[14086] | 50 | REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: fspu_2d,fspv_2d !: sponge arrays (2d mode) |
---|
| 51 | REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: fspt_2d, fspf_2d !: " " " " |
---|
[2715] | 52 | |
---|
[9019] | 53 | ! Barotropic arrays used to store open boundary data during time-splitting loop: |
---|
[12377] | 54 | REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: ubdy, vbdy, hbdy |
---|
| 55 | INTEGER , PUBLIC, SAVE :: Kbb_a, Kmm_a, Krhs_a !: AGRIF module-specific copies of time-level indices |
---|
[5656] | 56 | |
---|
[14086] | 57 | REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: ht0_parent, hu0_parent, hv0_parent |
---|
| 58 | REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: e3t0_parent, e3u0_parent, e3v0_parent |
---|
| 59 | INTEGER, PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: mbkt_parent, mbku_parent, mbkv_parent |
---|
[9019] | 60 | |
---|
[14086] | 61 | |
---|
| 62 | INTEGER, PUBLIC :: ts_interp_id, ts_update_id ! AGRIF profile for tracers interpolation and update |
---|
[9019] | 63 | INTEGER, PUBLIC :: un_interp_id, vn_interp_id ! AGRIF profiles for interpolations |
---|
| 64 | INTEGER, PUBLIC :: un_update_id, vn_update_id ! AGRIF profiles for udpates |
---|
[14086] | 65 | INTEGER, PUBLIC :: ts_sponge_id, un_sponge_id, vn_sponge_id ! AGRIF profiles for sponge layers (3d) |
---|
| 66 | INTEGER, PUBLIC :: unb_sponge_id, vnb_sponge_id ! AGRIF profiles for sponge layers (2d) |
---|
[13216] | 67 | INTEGER, PUBLIC :: tsini_id, uini_id, vini_id, sshini_id ! AGRIF profile for initialization |
---|
[5656] | 68 | # if defined key_top |
---|
[9019] | 69 | INTEGER, PUBLIC :: trn_id, trn_sponge_id |
---|
[5656] | 70 | # endif |
---|
[14086] | 71 | INTEGER, PUBLIC :: unb_interp_id, vnb_interp_id, ub2b_interp_id, vb2b_interp_id |
---|
| 72 | INTEGER, PUBLIC :: ub2b_update_id, vb2b_update_id, unb_update_id, vnb_update_id |
---|
| 73 | INTEGER, PUBLIC :: ub2b_cor_id, vb2b_cor_id |
---|
| 74 | INTEGER, PUBLIC :: e3t_id, sshn_id |
---|
[9019] | 75 | INTEGER, PUBLIC :: scales_t_id |
---|
| 76 | INTEGER, PUBLIC :: avt_id, avm_id, en_id ! TKE related identificators |
---|
[14086] | 77 | INTEGER, PUBLIC :: mbkt_id, ht0_id, e3t0_interp_id |
---|
[13286] | 78 | INTEGER, PUBLIC :: glamt_id, gphit_id |
---|
[14086] | 79 | INTEGER, PUBLIC :: batupd_id |
---|
[9019] | 80 | INTEGER, PUBLIC :: kindic_agr |
---|
[13216] | 81 | |
---|
| 82 | ! North fold |
---|
| 83 | !$AGRIF_DO_NOT_TREAT |
---|
| 84 | LOGICAL, PUBLIC :: use_sign_north |
---|
[14086] | 85 | REAL, PUBLIC :: sign_north |
---|
[13216] | 86 | LOGICAL, PUBLIC :: l_ini_child = .FALSE. |
---|
| 87 | LOGICAL, PUBLIC :: l_vremap = .FALSE. |
---|
| 88 | !$AGRIF_END_DO_NOT_TREAT |
---|
[9019] | 89 | |
---|
[1605] | 90 | !!---------------------------------------------------------------------- |
---|
[9598] | 91 | !! NEMO/NST 4.0 , NEMO Consortium (2018) |
---|
[1605] | 92 | !! $Id$ |
---|
[10068] | 93 | !! Software governed by the CeCILL license (see ./LICENSE) |
---|
[2715] | 94 | !!---------------------------------------------------------------------- |
---|
| 95 | CONTAINS |
---|
| 96 | |
---|
| 97 | INTEGER FUNCTION agrif_oce_alloc() |
---|
| 98 | !!---------------------------------------------------------------------- |
---|
| 99 | !! *** FUNCTION agrif_oce_alloc *** |
---|
| 100 | !!---------------------------------------------------------------------- |
---|
[5656] | 101 | INTEGER, DIMENSION(2) :: ierr |
---|
| 102 | !!---------------------------------------------------------------------- |
---|
| 103 | ierr(:) = 0 |
---|
| 104 | ! |
---|
[12377] | 105 | ALLOCATE( fspu(jpi,jpj), fspv(jpi,jpj), & |
---|
| 106 | & fspt(jpi,jpj), fspf(jpi,jpj), & |
---|
[14086] | 107 | & fspu_2d(jpi,jpj), fspv_2d(jpi,jpj), & |
---|
| 108 | & fspt_2d(jpi,jpj), fspf_2d(jpi,jpj), & |
---|
[12377] | 109 | & tabspongedone_tsn(jpi,jpj), & |
---|
| 110 | & utint_stage(jpi,jpj), vtint_stage(jpi,jpj), & |
---|
[5656] | 111 | # if defined key_top |
---|
| 112 | & tabspongedone_trn(jpi,jpj), & |
---|
[12377] | 113 | # endif |
---|
| 114 | & ht0_parent(jpi,jpj), mbkt_parent(jpi,jpj), & |
---|
| 115 | & hu0_parent(jpi,jpj), mbku_parent(jpi,jpj), & |
---|
| 116 | & hv0_parent(jpi,jpj), mbkv_parent(jpi,jpj), & |
---|
[5656] | 117 | & tabspongedone_u (jpi,jpj), & |
---|
| 118 | & tabspongedone_v (jpi,jpj), STAT = ierr(1) ) |
---|
| 119 | |
---|
[12377] | 120 | ALLOCATE( ubdy(jpi,jpj), vbdy(jpi,jpj), hbdy(jpi,jpj), STAT = ierr(2) ) |
---|
[5656] | 121 | |
---|
| 122 | agrif_oce_alloc = MAXVAL(ierr) |
---|
| 123 | ! |
---|
[2715] | 124 | END FUNCTION agrif_oce_alloc |
---|
| 125 | #endif |
---|
[1605] | 126 | !!====================================================================== |
---|
[782] | 127 | END MODULE agrif_oce |
---|