[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 |
---|
[4596] | 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 |
---|
| 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] |
---|
[4292] | 23 | REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: ua_sv, va_sv !: Saved trends (time spliting) [m/s2] |
---|
[2715] | 24 | REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: wn !: vertical velocity [m/s] |
---|
[4596] | 25 | REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: hdivn !: horizontal divergence [s-1] |
---|
[3294] | 26 | REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:,:) :: tsb , tsn !: 4D T-S fields [Celcius,psu] |
---|
[2715] | 27 | REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: rn2b , rn2 !: brunt-vaisala frequency**2 [s-2] |
---|
[1438] | 28 | ! |
---|
[3294] | 29 | REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:,:) :: tsa !: 4D T-S trends fields & work array |
---|
| 30 | ! |
---|
[2715] | 31 | REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: rhd !: in situ density anomalie rhd=(rho-rau0)/rau0 [no units] |
---|
| 32 | REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: rhop !: potential volumic mass [kg/m3] |
---|
[3] | 33 | |
---|
[2715] | 34 | !! free surface ! before ! now ! after ! |
---|
[4354] | 35 | !! ------------ ! fields ! fields ! fields ! |
---|
| 36 | REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: ub_b , un_b , ua_b !: Barotropic velocities at u-point [m/s] |
---|
| 37 | REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: vb_b , vn_b , va_b !: Barotropic velocities at v-point [m/s] |
---|
| 38 | REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: sshb , sshn , ssha !: sea surface height at t-point [m] |
---|
[2528] | 39 | ! |
---|
[2715] | 40 | REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: spgu, spgv !: horizontal surface pressure gradient |
---|
[359] | 41 | |
---|
[2528] | 42 | !! interpolated gradient (only used in zps case) |
---|
| 43 | !! --------------------- |
---|
[2715] | 44 | REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: gtsu, gtsv !: horizontal gradient of T, S bottom u-point |
---|
| 45 | REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: gru , grv !: horizontal gradient of rd at bottom u-point |
---|
[2528] | 46 | |
---|
[4152] | 47 | REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: rke !: kinetic energy |
---|
| 48 | |
---|
[3625] | 49 | !! arrays relating to embedding ice in the ocean. These arrays need to be declared |
---|
| 50 | !! even if no ice model is required. In the no ice model or traditional levitating |
---|
| 51 | !! ice cases they contain only zeros |
---|
| 52 | !! --------------------- |
---|
| 53 | REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: snwice_mass !: mass of snow and ice at current ice time step [Kg/m2] |
---|
| 54 | REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: snwice_mass_b !: mass of snow and ice at previous ice time step [Kg/m2] |
---|
| 55 | REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: snwice_fmass !: time evolution of mass of snow+ice [Kg/m2/s] |
---|
| 56 | |
---|
[4205] | 57 | !! arrays related to penetration of solar fluxes to calculate the heat budget for sea ice |
---|
| 58 | REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: oatte, iatte !: attenuation coef of the input solar flux [unitless] |
---|
| 59 | |
---|
[3] | 60 | !!---------------------------------------------------------------------- |
---|
[4596] | 61 | !! NEMO/OPA 4.0 , NEMO Consortium (2014) |
---|
[1438] | 62 | !! $Id$ |
---|
[2715] | 63 | !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt) |
---|
| 64 | !!---------------------------------------------------------------------- |
---|
| 65 | CONTAINS |
---|
| 66 | |
---|
| 67 | INTEGER FUNCTION oce_alloc() |
---|
| 68 | !!---------------------------------------------------------------------- |
---|
| 69 | !! *** FUNCTION oce_alloc *** |
---|
| 70 | !!---------------------------------------------------------------------- |
---|
[4205] | 71 | INTEGER :: ierr(4) |
---|
[2715] | 72 | !!---------------------------------------------------------------------- |
---|
| 73 | ! |
---|
| 74 | ALLOCATE( ub (jpi,jpj,jpk) , un (jpi,jpj,jpk) , ua(jpi,jpj,jpk) , & |
---|
| 75 | & vb (jpi,jpj,jpk) , vn (jpi,jpj,jpk) , va(jpi,jpj,jpk) , & |
---|
[4292] | 76 | & ua_sv(jpi,jpj,jpk) , va_sv(jpi,jpj,jpk) , & |
---|
[4596] | 77 | & wn (jpi,jpj,jpk) , hdivn(jpi,jpj,jpk) , & |
---|
[2715] | 78 | & tsb (jpi,jpj,jpk,jpts) , tsn (jpi,jpj,jpk,jpts) , tsa(jpi,jpj,jpk,jpts) , & |
---|
[4596] | 79 | & rn2b (jpi,jpj,jpk) , rn2 (jpi,jpj,jpk) , & |
---|
| 80 | & rhd (jpi,jpj,jpk) , rhop (jpi,jpj,jpk) , STAT=ierr(1) ) |
---|
[2715] | 81 | ! |
---|
[4596] | 82 | ALLOCATE( sshb(jpi,jpj) , sshn(jpi,jpj) , ssha(jpi,jpj), & |
---|
| 83 | & ub_b(jpi,jpj) , un_b(jpi,jpj) , ua_b(jpi,jpj), & |
---|
| 84 | & vb_b(jpi,jpj) , vn_b(jpi,jpj) , va_b(jpi,jpj), & |
---|
| 85 | & spgu(jpi,jpj) , spgv(jpi,jpj) , & |
---|
| 86 | & gru (jpi,jpj) , grv (jpi,jpj) , & |
---|
| 87 | & gtsu(jpi,jpj,jpts), gtsv(jpi,jpj,jpts) , STAT=ierr(2) ) |
---|
[2715] | 88 | ! |
---|
[4205] | 89 | ALLOCATE( snwice_mass(jpi,jpj) , snwice_mass_b(jpi,jpj), snwice_fmass(jpi,jpj) , STAT=ierr(3) ) |
---|
[3625] | 90 | ! |
---|
[4205] | 91 | ALLOCATE( iatte(jpi,jpj) , oatte(jpi,jpj) , STAT=ierr(4) ) |
---|
| 92 | ! |
---|
[2715] | 93 | oce_alloc = MAXVAL( ierr ) |
---|
| 94 | IF( oce_alloc /= 0 ) CALL ctl_warn('oce_alloc: failed to allocate arrays') |
---|
| 95 | ! |
---|
| 96 | END FUNCTION oce_alloc |
---|
| 97 | |
---|
[1438] | 98 | !!====================================================================== |
---|
[3] | 99 | END MODULE oce |
---|