[12614] | 1 | MODULE usrdef_nam |
---|
| 2 | !!====================================================================== |
---|
| 3 | !! *** MODULE usrdef_nam *** |
---|
| 4 | !! |
---|
| 5 | !! === AM98 configuration === |
---|
| 6 | !! |
---|
| 7 | !! User defined : set the domain characteristics of a user configuration |
---|
| 8 | !!====================================================================== |
---|
| 9 | !! History : 4.0 ! 2016-03 (S. Flavoni, G. Madec) Original code |
---|
| 10 | !!---------------------------------------------------------------------- |
---|
| 11 | |
---|
| 12 | !!---------------------------------------------------------------------- |
---|
| 13 | !! usr_def_nam : read user defined namelist and set global domain size |
---|
| 14 | !! usr_def_hgr : initialize the horizontal mesh |
---|
| 15 | !!---------------------------------------------------------------------- |
---|
| 16 | USE dom_oce , ONLY: nimpp, njmpp ! ocean space and time domain |
---|
| 17 | USE par_oce ! ocean space and time domain |
---|
| 18 | USE phycst ! physical constants |
---|
| 19 | ! |
---|
| 20 | USE in_out_manager ! I/O manager |
---|
| 21 | USE lib_mpp ! MPP library |
---|
| 22 | |
---|
| 23 | IMPLICIT NONE |
---|
| 24 | PRIVATE |
---|
| 25 | |
---|
| 26 | PUBLIC usr_def_nam ! called in nemogcm.F90 module |
---|
| 27 | ! !!* namusr_def namelist *!! |
---|
| 28 | INTEGER , PUBLIC :: nn_AM98 ! 1/nn_AM98 = the resolution chosen in degrees and thus defining the horizontal domain size |
---|
| 29 | REAL(wp), PUBLIC :: rn_theta ! rotation angle (in degree) of the grid |
---|
[13005] | 30 | INTEGER , PUBLIC :: nn_gc ! number of ghostcells |
---|
| 31 | REAL(wp), PUBLIC :: rn_domsiz ! size of the domain (default 2000km) [m] |
---|
| 32 | REAL(wp), PUBLIC :: rn_dx ! gridspacing (default 100km) [m] |
---|
| 33 | REAL(wp), PUBLIC :: rn_tau ! wind stress on the surface [N/m2] |
---|
| 34 | REAL(wp), PUBLIC :: rn_f0 ! f-plan coriolis parameter [1/s] |
---|
| 35 | REAL(wp), PUBLIC :: rn_beta ! beta-plan coriolis parameter [1/m.s] |
---|
| 36 | REAL(wp), PUBLIC :: rn_modified_grav ! modified gravity [m/s2] |
---|
| 37 | REAL(wp), PUBLIC :: rn_rfr ! layer friction [1/s] |
---|
| 38 | ! !!* temporary *!! |
---|
| 39 | INTEGER , PUBLIC :: nn_dynldf_lap_typ ! choose type of laplacian (ideally from namelist) |
---|
| 40 | ! ! = 1 divrot laplacian |
---|
| 41 | ! ! = 2 symmetric laplacian (Griffies&Hallberg 2000) |
---|
| 42 | ! ! = 3 symmetric laplacian (cartesian) |
---|
| 43 | LOGICAL , PUBLIC :: ln_dynldf_lap_PM ! if True - apply the P.Marchand boundary condition on the laplacian |
---|
[13416] | 44 | ! !!* penalisation *!! |
---|
| 45 | REAL(wp), PUBLIC :: rn_abp ! alpha boundary parameter [-] |
---|
| 46 | INTEGER , PUBLIC :: nn_cnp ! number of cell on which is smoothed the porosity (phi) [-] |
---|
| 47 | REAL(wp), PUBLIC :: rn_fsp ! friction parameter 1/epsilon of the permeability [1/s] |
---|
[12614] | 48 | ! |
---|
[13416] | 49 | REAL(wp), PUBLIC :: r1_abp ! inverse alpha boundary parameter [-] |
---|
| 50 | ! |
---|
[12614] | 51 | !!---------------------------------------------------------------------- |
---|
| 52 | !! NEMO/OCE 4.0 , NEMO Consortium (2018) |
---|
| 53 | !! $Id: usrdef_nam.F90 11536 2019-09-11 13:54:18Z smasson $ |
---|
| 54 | !! Software governed by the CeCILL license (see ./LICENSE) |
---|
| 55 | !!---------------------------------------------------------------------- |
---|
| 56 | CONTAINS |
---|
| 57 | |
---|
| 58 | SUBROUTINE usr_def_nam( cd_cfg, kk_cfg, kpi, kpj, kpk, kperio ) |
---|
| 59 | !!---------------------------------------------------------------------- |
---|
| 60 | !! *** ROUTINE dom_nam *** |
---|
| 61 | !! |
---|
| 62 | !! ** Purpose : read user defined namelist and define the domain size |
---|
| 63 | !! |
---|
| 64 | !! ** Method : read in namusr_def containing all the user specific namelist parameter |
---|
| 65 | !! |
---|
| 66 | !! Here AM98 configuration |
---|
| 67 | !! |
---|
| 68 | !! ** input : - namusr_def namelist found in namelist_cfg |
---|
| 69 | !!---------------------------------------------------------------------- |
---|
| 70 | CHARACTER(len=*), INTENT(out) :: cd_cfg ! configuration name |
---|
| 71 | INTEGER , INTENT(out) :: kk_cfg ! configuration resolution |
---|
| 72 | INTEGER , INTENT(out) :: kpi, kpj, kpk ! global domain sizes |
---|
| 73 | INTEGER , INTENT(out) :: kperio ! lateral global domain b.c. |
---|
| 74 | ! |
---|
| 75 | INTEGER :: ios ! Local integer |
---|
| 76 | REAL(wp) :: ze1, zgl, zbl ! gridspacing, length of the biggest square |
---|
| 77 | !! |
---|
[13005] | 78 | NAMELIST/namusr_def/ nn_AM98, rn_theta, jpkglo, & ! |
---|
| 79 | & nn_gc ,rn_domsiz, rn_dx, & ! domain parameters |
---|
[12614] | 80 | & rn_f0 ,rn_beta, & ! coriolis parameter |
---|
[13005] | 81 | & rn_modified_grav, rn_rfr , rn_tau, & ! reduced gravity, friction, wind |
---|
[13416] | 82 | & nn_dynldf_lap_typ, ln_dynldf_lap_PM, & ! temporary parameter |
---|
| 83 | & rn_abp, nn_cnp, rn_fsp ! penalisation parameters |
---|
[12614] | 84 | !!---------------------------------------------------------------------- |
---|
| 85 | ! |
---|
| 86 | READ ( numnam_cfg, namusr_def, IOSTAT = ios, ERR = 902 ) |
---|
| 87 | 902 IF( ios /= 0 ) CALL ctl_nam ( ios , 'namusr_def in configuration namelist' ) |
---|
| 88 | ! |
---|
| 89 | IF(lwm) WRITE( numond, namusr_def ) |
---|
| 90 | ! |
---|
| 91 | cd_cfg = 'AM98' ! name & resolution (not used) |
---|
| 92 | |
---|
| 93 | #if defined key_agrif |
---|
| 94 | IF (.NOT.Agrif_root()) nn_AM98 = Agrif_parent(nn_AM98) * Agrif_irhox() |
---|
| 95 | #endif |
---|
| 96 | |
---|
| 97 | kk_cfg = nn_AM98 |
---|
[13005] | 98 | ! |
---|
| 99 | ze1 = rn_dx / REAL(nn_AM98, wp) ! [m] gridspacing used |
---|
| 100 | zgl = rn_domsiz + 2._wp * REAL(nn_gc, wp) * ze1 ! [m] length of the square with ghostcells |
---|
| 101 | ! rotation |
---|
[12614] | 102 | zbl = zgl * ( COS( rn_theta * rad ) + SIN( rn_theta * rad ) ) ! length side bigger domain [m] |
---|
[13005] | 103 | ! |
---|
[12614] | 104 | kpi = ceiling(zbl / ze1 ) ! Global Domain size + ghost cells |
---|
| 105 | kpj = ceiling(zbl / ze1 ) ! Global Domain size + ghost cells |
---|
| 106 | ! |
---|
| 107 | IF( rn_modified_grav /= 0._wp) grav = rn_modified_grav ! update the gravity |
---|
| 108 | ! |
---|
| 109 | kpk = jpkglo |
---|
| 110 | ! ! Set the lateral boundary condition of the global domain |
---|
| 111 | kperio = 0 ! AM98 configuration : closed domain |
---|
| 112 | ! |
---|
[13416] | 113 | # if defined key_bvp |
---|
| 114 | r1_abp = 1._wp / rn_abp |
---|
| 115 | #endif |
---|
[12614] | 116 | ! ! control print |
---|
| 117 | IF(lwp) THEN |
---|
| 118 | WRITE(numout,*) ' ' |
---|
| 119 | WRITE(numout,*) 'usr_def_nam : read the user defined namelist (namusr_def) in namelist_cfg' |
---|
| 120 | WRITE(numout,*) '~~~~~~~~~~~ ' |
---|
| 121 | WRITE(numout,*) ' Namelist namusr_def : AM98 case' |
---|
[13005] | 122 | WRITE(numout,*) ' domain size rn_domsiz = ', rn_domsiz, 'm' |
---|
| 123 | WRITE(numout,*) ' gridspacing rn_dx = ', rn_dx, 'm' |
---|
[12614] | 124 | WRITE(numout,*) ' inverse resolution & implied domain size nn_AM98 = ', nn_AM98 |
---|
[13005] | 125 | WRITE(numout,*) ' implied gridspacing rn_dx = ', rn_dx, 'm' |
---|
| 126 | WRITE(numout,*) ' number of ghostcells nn_gc = ', nn_gc |
---|
| 127 | WRITE(numout,*) ' ' |
---|
| 128 | WRITE(numout,*) ' rotation angle chosen rn_theta = ', rn_theta, 'deg' |
---|
| 129 | WRITE(numout,*) ' modified gravity rn_modified_grav = ', rn_modified_grav, 'm2/s' |
---|
[12614] | 130 | WRITE(numout,*) ' number of model levels jpkglo = ', kpk |
---|
| 131 | WRITE(numout,*) ' ' |
---|
| 132 | WRITE(numout,*) ' Lateral b.c. of the global domain set to closed jperio = ', kperio |
---|
| 133 | ENDIF |
---|
| 134 | ! |
---|
| 135 | END SUBROUTINE usr_def_nam |
---|
| 136 | |
---|
| 137 | !!====================================================================== |
---|
| 138 | END MODULE usrdef_nam |
---|