[3] | 1 | MODULE oce |
---|
| 2 | !!====================================================================== |
---|
[15] | 3 | !! *** MODULE oce *** |
---|
[3] | 4 | !! Ocean : dynamics and active tracers defined in memory |
---|
| 5 | !!====================================================================== |
---|
[2528] | 6 | !! History : 1.0 ! 2002-11 (G. Madec) F90: Free form and module |
---|
[1438] | 7 | !! 3.1 ! 2009-02 (G. Madec, M. Leclair) pure z* coordinate |
---|
[2528] | 8 | !! 3.3 ! 2010-09 (C. Ethe) TRA-TRC merge: add ts, gtsu, gtsv 4D arrays |
---|
[5836] | 9 | !! 3.7 ! 2014-01 (G. Madec) suppression of curl and before hdiv from in-core memory |
---|
[3] | 10 | !!---------------------------------------------------------------------- |
---|
[2715] | 11 | USE par_oce ! ocean parameters |
---|
| 12 | USE lib_mpp ! MPP library |
---|
[3] | 13 | |
---|
| 14 | IMPLICIT NONE |
---|
[15] | 15 | PRIVATE |
---|
[3] | 16 | |
---|
[2715] | 17 | PUBLIC oce_alloc ! routine called by nemo_init in nemogcm.F90 |
---|
[3] | 18 | |
---|
[2715] | 19 | !! dynamics and tracer fields ! before ! now ! after ! the after trends becomes the fields |
---|
| 20 | !! -------------------------- ! fields ! fields ! trends ! only after tra_zdf and dyn_spg |
---|
[5836] | 21 | REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: ub , un , ua !: i-horizontal velocity [m/s] |
---|
| 22 | REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: vb , vn , va !: j-horizontal velocity [m/s] |
---|
| 23 | REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: wn !: vertical velocity [m/s] |
---|
| 24 | REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: hdivn !: horizontal divergence [s-1] |
---|
[4990] | 25 | REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:,:) :: tsb , tsn , tsa !: 4D T-S fields [Celcius,psu] |
---|
| 26 | REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:,:) :: rab_b, rab_n !: thermal/haline expansion coef. [Celcius-1,psu-1] |
---|
| 27 | REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: rn2b , rn2 !: brunt-vaisala frequency**2 [s-2] |
---|
[1438] | 28 | ! |
---|
[2715] | 29 | REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: rhd !: in situ density anomalie rhd=(rho-rau0)/rau0 [no units] |
---|
| 30 | REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: rhop !: potential volumic mass [kg/m3] |
---|
[3] | 31 | |
---|
[2715] | 32 | !! free surface ! before ! now ! after ! |
---|
[4354] | 33 | !! ------------ ! fields ! fields ! fields ! |
---|
| 34 | REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: ub_b , un_b , ua_b !: Barotropic velocities at u-point [m/s] |
---|
| 35 | REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: vb_b , vn_b , va_b !: Barotropic velocities at v-point [m/s] |
---|
| 36 | REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: sshb , sshn , ssha !: sea surface height at t-point [m] |
---|
[2528] | 37 | ! |
---|
[2715] | 38 | REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: spgu, spgv !: horizontal surface pressure gradient |
---|
[359] | 39 | |
---|
[5930] | 40 | !! Specific to split explicit free surface (allocated in dynspg_ts module): |
---|
| 41 | ! |
---|
| 42 | !! Time filtered arrays at baroclinic time step: |
---|
| 43 | REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: un_adv, vn_adv ! Advection vel. at "now" barocl. step |
---|
| 44 | REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: ub2_b , vb2_b ! Half step fluxes (ln_bt_fw=T) |
---|
| 45 | #if defined key_agrif |
---|
| 46 | REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: ub2_i_b, vb2_i_b ! Half step time integrated fluxes |
---|
| 47 | #endif |
---|
| 48 | |
---|
| 49 | !! Arrays at barotropic time step: ! bef before ! before ! now ! after ! |
---|
| 50 | REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: ubb_e , ub_e , un_e , ua_e |
---|
| 51 | REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: vbb_e , vb_e , vn_e , va_e |
---|
| 52 | REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: sshbb_e , sshb_e , sshn_e , ssha_e |
---|
| 53 | REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: hu_e |
---|
| 54 | REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: hv_e |
---|
| 55 | REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: hur_e |
---|
| 56 | REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: hvr_e |
---|
| 57 | |
---|
[2528] | 58 | !! interpolated gradient (only used in zps case) |
---|
| 59 | !! --------------------- |
---|
[2715] | 60 | REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: gtsu, gtsv !: horizontal gradient of T, S bottom u-point |
---|
| 61 | REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: gru , grv !: horizontal gradient of rd at bottom u-point |
---|
[4990] | 62 | REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: aru , arv |
---|
| 63 | REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: gzu , gzv |
---|
| 64 | REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: ge3ru, ge3rv !: horizontal gradient of T, S and rd at top v-point |
---|
[2528] | 65 | |
---|
[4990] | 66 | !! (ISF) interpolated gradient (only used for ice shelf case) |
---|
| 67 | !! --------------------- |
---|
| 68 | REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: gtui, gtvi !: horizontal gradient of T, S and rd at top u-point |
---|
| 69 | REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: grui, grvi !: horizontal gradient of T, S and rd at top v-point |
---|
| 70 | REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: arui, arvi !: horizontal average of rd at top v-point |
---|
| 71 | REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: gzui, gzvi !: horizontal gradient of z at top v-point |
---|
| 72 | REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: ge3rui, ge3rvi !: horizontal gradient of T, S and rd at top v-point |
---|
| 73 | !! (ISF) ice load |
---|
| 74 | REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: riceload |
---|
| 75 | |
---|
[4152] | 76 | REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: rke !: kinetic energy |
---|
| 77 | |
---|
[3625] | 78 | !! arrays relating to embedding ice in the ocean. These arrays need to be declared |
---|
| 79 | !! even if no ice model is required. In the no ice model or traditional levitating |
---|
| 80 | !! ice cases they contain only zeros |
---|
| 81 | !! --------------------- |
---|
| 82 | REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: snwice_mass !: mass of snow and ice at current ice time step [Kg/m2] |
---|
| 83 | REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: snwice_mass_b !: mass of snow and ice at previous ice time step [Kg/m2] |
---|
| 84 | REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: snwice_fmass !: time evolution of mass of snow+ice [Kg/m2/s] |
---|
| 85 | |
---|
[4990] | 86 | !! Energy budget of the leads (open water embedded in sea ice) |
---|
| 87 | REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: fraqsr_1lev !: fraction of solar net radiation absorbed in the first ocean level [-] |
---|
[4205] | 88 | |
---|
[3] | 89 | !!---------------------------------------------------------------------- |
---|
[5836] | 90 | !! NEMO/OPA 3.7 , NEMO Consortium (2014) |
---|
[1438] | 91 | !! $Id$ |
---|
[2715] | 92 | !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt) |
---|
| 93 | !!---------------------------------------------------------------------- |
---|
| 94 | CONTAINS |
---|
| 95 | |
---|
| 96 | INTEGER FUNCTION oce_alloc() |
---|
| 97 | !!---------------------------------------------------------------------- |
---|
| 98 | !! *** FUNCTION oce_alloc *** |
---|
| 99 | !!---------------------------------------------------------------------- |
---|
[4205] | 100 | INTEGER :: ierr(4) |
---|
[2715] | 101 | !!---------------------------------------------------------------------- |
---|
| 102 | ! |
---|
| 103 | ALLOCATE( ub (jpi,jpj,jpk) , un (jpi,jpj,jpk) , ua(jpi,jpj,jpk) , & |
---|
[5930] | 104 | & vb (jpi,jpj,jpk) , vn (jpi,jpj,jpk) , va(jpi,jpj,jpk) , & |
---|
[5836] | 105 | & wn (jpi,jpj,jpk) , hdivn(jpi,jpj,jpk) , & |
---|
[2715] | 106 | & tsb (jpi,jpj,jpk,jpts) , tsn (jpi,jpj,jpk,jpts) , tsa(jpi,jpj,jpk,jpts) , & |
---|
[4990] | 107 | & rab_b(jpi,jpj,jpk,jpts) , rab_n(jpi,jpj,jpk,jpts) , & |
---|
[5836] | 108 | & rn2b (jpi,jpj,jpk) , rn2 (jpi,jpj,jpk) , & |
---|
| 109 | & rhd (jpi,jpj,jpk) , rhop (jpi,jpj,jpk) , STAT=ierr(1) ) |
---|
[2715] | 110 | ! |
---|
[5836] | 111 | ALLOCATE(rke(jpi,jpj,jpk) , & |
---|
[4354] | 112 | & sshb(jpi,jpj) , sshn(jpi,jpj) , ssha(jpi,jpj) , & |
---|
| 113 | & ub_b(jpi,jpj) , un_b(jpi,jpj) , ua_b(jpi,jpj) , & |
---|
| 114 | & vb_b(jpi,jpj) , vn_b(jpi,jpj) , va_b(jpi,jpj) , & |
---|
[4292] | 115 | & spgu (jpi,jpj) , spgv(jpi,jpj) , & |
---|
| 116 | & gtsu(jpi,jpj,jpts), gtsv(jpi,jpj,jpts), & |
---|
[4990] | 117 | & aru(jpi,jpj) , arv(jpi,jpj) , & |
---|
| 118 | & gzu(jpi,jpj) , gzv(jpi,jpj) , & |
---|
| 119 | & gru(jpi,jpj) , grv(jpi,jpj) , & |
---|
| 120 | & ge3ru(jpi,jpj) , ge3rv(jpi,jpj) , & |
---|
| 121 | & gtui(jpi,jpj,jpts), gtvi(jpi,jpj,jpts), & |
---|
| 122 | & arui(jpi,jpj) , arvi(jpi,jpj) , & |
---|
| 123 | & gzui(jpi,jpj) , gzvi(jpi,jpj) , & |
---|
| 124 | & ge3rui(jpi,jpj) , ge3rvi(jpi,jpj) , & |
---|
| 125 | & grui(jpi,jpj) , grvi(jpi,jpj) , & |
---|
| 126 | & riceload(jpi,jpj), STAT=ierr(2) ) |
---|
[2715] | 127 | ! |
---|
[4205] | 128 | ALLOCATE( snwice_mass(jpi,jpj) , snwice_mass_b(jpi,jpj), snwice_fmass(jpi,jpj) , STAT=ierr(3) ) |
---|
[3625] | 129 | ! |
---|
[4990] | 130 | ALLOCATE( fraqsr_1lev(jpi,jpj) , STAT=ierr(4) ) |
---|
[4205] | 131 | ! |
---|
[2715] | 132 | oce_alloc = MAXVAL( ierr ) |
---|
| 133 | IF( oce_alloc /= 0 ) CALL ctl_warn('oce_alloc: failed to allocate arrays') |
---|
| 134 | ! |
---|
| 135 | END FUNCTION oce_alloc |
---|
| 136 | |
---|
[1438] | 137 | !!====================================================================== |
---|
[3] | 138 | END MODULE oce |
---|