- Timestamp:
- 2021-04-09T19:03:15+02:00 (3 years ago)
- Location:
- NEMO/branches/2021/dev_r14608_AGRIF_domcfg/tests/ICE_AGRIF/MY_SRC
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
NEMO/branches/2021/dev_r14608_AGRIF_domcfg/tests/ICE_AGRIF/MY_SRC/usrdef_hgr.F90
r14673 r14688 23 23 IMPLICIT NONE 24 24 PRIVATE 25 26 REAL(wp) :: roffsetx, roffsety ! Offset in km to first f-point 25 27 26 28 PUBLIC usr_def_hgr ! called by domhgr.F90 … … 50 52 !! without Coriolis force (f=0) 51 53 !! 52 !! ** Action : - define longitude & latitude of t-, u-, v- and f-points (in degrees)54 !! ** Action : - define longitude & latitude of t-, u-, v- and f-points (in kms) 53 55 !! - define coriolis parameter at f-point if the domain in not on the sphere (on beta-plane) 54 56 !! - define i- & j-scale factors at t-, u-, v- and f-points (in meters) … … 65 67 ! 66 68 INTEGER :: ji, jj ! dummy loop indices 67 REAL(wp) :: z phi0, zlam0, zbeta, zf069 REAL(wp) :: zbeta, zf0 68 70 REAL(wp) :: zti, ztj ! local scalars 69 71 !!------------------------------------------------------------------------------- … … 74 76 IF(lwp) WRITE(numout,*) ' f-plane with irregular grid-spacing (+- 10%)' 75 77 IF(lwp) WRITE(numout,*) ' the max is given by rn_dx and rn_dy' 78 ! 79 ! 80 ! Position coordinates (in kilometers) 81 ! ========== 82 ! Offset is given at first f-point, i.e. at (i,j) = (nn_hls+1, nn_hls+1) 83 ! Here we assume the grid is centred around a T-point at the middle of 84 ! of the domain (hence domain size is odd) 85 roffsetx = (-REAL(Ni0glo-1, wp) + 1._wp) * 0.5 * 1.e-3 * rn_dx 86 roffsety = (-REAL(Nj0glo-1, wp) + 1._wp) * 0.5 * 1.e-3 * rn_dy 87 #if defined key_agrif 88 IF( .NOT.Agrif_Root() ) THEN 89 ! deduce offset from parent: 90 roffsetx = Agrif_Parent(roffsetx) & 91 & + (-(nbghostcells_x - 1) + (Agrif_Parent(nbghostcells_x ) & 92 & + Agrif_Ix()-2)*Agrif_Rhox()) * 1.e-3 * rn_dx 93 roffsety = Agrif_Parent(roffsety) & 94 & + (-(nbghostcells_y_s - 1) + (Agrif_Parent(nbghostcells_y_s) & 95 & + Agrif_Iy()-2)*Agrif_Rhoy()) * 1.e-3 * rn_dy 96 ENDIF 97 #endif 98 DO_2D( nn_hls, nn_hls, nn_hls, nn_hls ) 99 zti = REAL( mig0(ji)-1, wp ) ! start at i=0 in the global grid without halos 100 ztj = REAL( mjg0(jj)-1, wp ) ! start at j=0 in the global grid without halos 76 101 77 ! ========== 78 #if defined key_agrif 79 IF( Agrif_Root() ) THEN 80 #endif 81 zlam0 = -REAL(Ni0glo-1, wp) * 0.5 * 1.e-3 * rn_dx 82 zphi0 = -REAL(Nj0glo-1, wp) * 0.5 * 1.e-3 * rn_dy 83 #if defined key_agrif 84 ELSE 85 ! ! let lower left longitude and latitude from parent 86 !clem zlam0 = Agrif_Parent(zlam0) + (Agrif_ix())*Agrif_Parent(rn_dx) * 1.e-5 87 !clem zphi0 = Agrif_Parent(zphi0) + (Agrif_iy())*Agrif_Parent(rn_dy) * 1.e-5 88 zlam0 = ( 0.5_wp - REAL(Agrif_Parent(Ni0glo)-1, wp) * 0.5 ) * 1.e-3 * Agrif_irhox() * rn_dx & 89 & + ( Agrif_Ix() + Agrif_Parent(nbghostcells_x ) - 1 ) * Agrif_irhox() * rn_dx * 1.e-3 - ( 0.5_wp + nbghostcells_x ) * rn_dx * 1.e-3 90 zphi0 = ( 0.5_wp - REAL(Agrif_Parent(Nj0glo)-1, wp) * 0.5 ) * 1.e-3 * Agrif_irhoy() * rn_dy & 91 & + ( Agrif_Iy() + Agrif_Parent(nbghostcells_y_s) - 1 ) * Agrif_irhoy() * rn_dy * 1.e-3 - ( 0.5_wp + nbghostcells_y_s ) * rn_dy * 1.e-3 92 ENDIF 93 #endif 102 plamt(ji,jj) = roffsetx + rn_dx * 1.e-3 * ( zti - 0.5_wp ) 103 plamu(ji,jj) = roffsetx + rn_dx * 1.e-3 * zti 104 plamv(ji,jj) = plamt(ji,jj) 105 plamf(ji,jj) = plamu(ji,jj) 94 106 95 DO_2D( nn_hls, nn_hls, nn_hls, nn_hls ) 96 zti = REAL( mig0(ji)-1, wp ) ! start at i=0. in the global grid without halos 97 ztj = REAL( mjg0(jj)-1, wp ) ! start at j=0. in the global grid without halos 98 99 plamt(ji,jj) = zlam0 + rn_dx * 1.e-3 * zti 100 plamu(ji,jj) = zlam0 + rn_dx * 1.e-3 * ( zti + 0.5_wp ) 101 plamv(ji,jj) = plamt(ji,jj) 102 plamf(ji,jj) = plamu(ji,jj) 103 104 pphit(ji,jj) = zphi0 + rn_dy * 1.e-3 * ztj 105 pphiv(ji,jj) = zphi0 + rn_dy * 1.e-3 * ( ztj + 0.5_wp ) 106 pphiu(ji,jj) = pphit(ji,jj) 107 pphif(ji,jj) = pphiv(ji,jj) 107 pphit(ji,jj) = roffsety + rn_dy * 1.e-3 * ( ztj - 0.5_wp ) 108 pphiv(ji,jj) = roffsety + rn_dy * 1.e-3 * ztj 109 pphiu(ji,jj) = pphit(ji,jj) 110 pphif(ji,jj) = pphiv(ji,jj) 108 111 END_2D 109 110 111 112 ! 113 ! Horizontal scale factors (in meters) 114 ! ====== 112 115 !! ==> EITHER 1) variable scale factors 113 116 !! clem: This can be used with a 1proc simulation but I think it breaks repro when >1procs are used -
NEMO/branches/2021/dev_r14608_AGRIF_domcfg/tests/ICE_AGRIF/MY_SRC/usrdef_nam.F90
r14433 r14688 88 88 kpj = NINT( 300.e3 / rn_dy ) - 3 89 89 ELSE ! Global Domain size: add nbghostcells + 1 "land" point on each side 90 kpi = nbcellsx + 2 * ( nbghostcells + 1 ) 91 kpj = nbcellsy + 2 * ( nbghostcells + 1 ) 90 kpi = nbcellsx + 2 * nbghostcells 91 kpj = nbcellsy + 2 * nbghostcells 92 !! JC: number of ghosts unknown at this tage 92 93 !!$ kpi = nbcellsx + nbghostcells_x + nbghostcells_x + 2 93 94 !!$ kpj = nbcellsy + nbghostcells_y_s + nbghostcells_y_n + 2
Note: See TracChangeset
for help on using the changeset viewer.