[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 | |
---|
[10876] | 19 | !! dynamics and tracer fields NOTE THAT "TARGET" ATTRIBUTE CAN BE REMOVED AFTER IMMERSE DEVELOPMENT FINISHED |
---|
| 20 | !! -------------------------- |
---|
| 21 | REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:,:), TARGET :: uu , vv !: horizontal velocities [m/s] |
---|
| 22 | REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:), TARGET :: ww !: vertical velocity [m/s] |
---|
| 23 | REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: wi !: vertical vel. (adaptive-implicit) [m/s] |
---|
| 24 | REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:), TARGET :: hdiv !: horizontal divergence [s-1] |
---|
| 25 | REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:,:,:),TARGET :: ts !: 4D T-S fields [Celsius,psu] |
---|
[10874] | 26 | REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:,:) :: rab_b, rab_n !: thermal/haline expansion coef. [Celsius-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] |
---|
[10364] | 31 | REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: Cu_adv !: vertical Courant number (adaptive-implicit) |
---|
[3] | 32 | |
---|
[2715] | 33 | !! free surface ! before ! now ! after ! |
---|
[4354] | 34 | !! ------------ ! fields ! fields ! fields ! |
---|
[10919] | 35 | REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:), TARGET :: ssh, uu_b, vv_b !: SSH [m] and barotropic velocities [m/s] |
---|
[359] | 36 | |
---|
[6140] | 37 | !! Arrays at barotropic time step: ! befbefore! before ! now ! after ! |
---|
| 38 | REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: ubb_e , ub_e , un_e , ua_e !: u-external velocity |
---|
| 39 | REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: vbb_e , vb_e , vn_e , va_e !: v-external velocity |
---|
| 40 | REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: sshbb_e, sshb_e, sshn_e, ssha_e !: external ssh |
---|
| 41 | REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: hu_e !: external u-depth |
---|
| 42 | REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: hv_e !: external v-depth |
---|
| 43 | REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: hur_e !: inverse of u-depth |
---|
| 44 | REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: hvr_e !: inverse of v-depth |
---|
| 45 | REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: ub2_b , vb2_b !: Half step fluxes (ln_bt_fw=T) |
---|
[9023] | 46 | REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: un_bf , vn_bf !: Asselin filtered half step fluxes (ln_bt_fw=T) |
---|
[5930] | 47 | #if defined key_agrif |
---|
[6140] | 48 | REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: ub2_i_b, vb2_i_b !: Half step time integrated fluxes |
---|
[5930] | 49 | #endif |
---|
[6140] | 50 | ! |
---|
| 51 | REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: spgu, spgv !: horizontal surface pressure gradient |
---|
[5930] | 52 | |
---|
[2528] | 53 | !! interpolated gradient (only used in zps case) |
---|
| 54 | !! --------------------- |
---|
[2715] | 55 | REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: gtsu, gtsv !: horizontal gradient of T, S bottom u-point |
---|
| 56 | REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: gru , grv !: horizontal gradient of rd at bottom u-point |
---|
[2528] | 57 | |
---|
[4990] | 58 | !! (ISF) interpolated gradient (only used for ice shelf case) |
---|
| 59 | !! --------------------- |
---|
| 60 | REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: gtui, gtvi !: horizontal gradient of T, S and rd at top u-point |
---|
| 61 | REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: grui, grvi !: horizontal gradient of T, S and rd at top v-point |
---|
| 62 | !! (ISF) ice load |
---|
| 63 | REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: riceload |
---|
| 64 | |
---|
| 65 | !! Energy budget of the leads (open water embedded in sea ice) |
---|
| 66 | REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: fraqsr_1lev !: fraction of solar net radiation absorbed in the first ocean level [-] |
---|
[4205] | 67 | |
---|
[10876] | 68 | !! TEMPORARY POINTERS FOR DEVELOPMENT ONLY |
---|
[10919] | 69 | REAL(wp), PUBLIC, POINTER, SAVE, DIMENSION(:,:,:) :: ub , un , ua !: i-horizontal velocity [m/s] |
---|
| 70 | REAL(wp), PUBLIC, POINTER, SAVE, DIMENSION(:,:,:) :: vb , vn , va !: j-horizontal velocity [m/s] |
---|
| 71 | REAL(wp), PUBLIC, POINTER, SAVE, DIMENSION(:,:,:) :: wn !: k-vertical velocity [m/s] |
---|
| 72 | REAL(wp), PUBLIC, POINTER, SAVE, DIMENSION(:,:,:) :: hdivn !: horizontal divergence [s-1] |
---|
| 73 | REAL(wp), PUBLIC, POINTER, SAVE, DIMENSION(:,:,:,:) :: tsb , tsn , tsa !: 4D T-S fields [Celsius,psu] |
---|
| 74 | REAL(wp), PUBLIC, POINTER, SAVE, DIMENSION(:,:) :: ub_b , un_b , ua_b !: Barotropic velocities at u-point [m/s] |
---|
| 75 | REAL(wp), PUBLIC, POINTER, SAVE, DIMENSION(:,:) :: vb_b , vn_b , va_b !: Barotropic velocities at v-point [m/s] |
---|
| 76 | REAL(wp), PUBLIC, POINTER, SAVE, DIMENSION(:,:) :: sshb , sshn , ssha !: sea surface height at t-point [m] |
---|
[10876] | 77 | !! TEMPORARY POINTERS FOR DEVELOPMENT ONLY |
---|
| 78 | |
---|
[3] | 79 | !!---------------------------------------------------------------------- |
---|
[9598] | 80 | !! NEMO/OCE 4.0 , NEMO Consortium (2018) |
---|
[1438] | 81 | !! $Id$ |
---|
[10068] | 82 | !! Software governed by the CeCILL license (see ./LICENSE) |
---|
[2715] | 83 | !!---------------------------------------------------------------------- |
---|
| 84 | CONTAINS |
---|
| 85 | |
---|
| 86 | INTEGER FUNCTION oce_alloc() |
---|
| 87 | !!---------------------------------------------------------------------- |
---|
| 88 | !! *** FUNCTION oce_alloc *** |
---|
| 89 | !!---------------------------------------------------------------------- |
---|
[9019] | 90 | INTEGER :: ierr(6) |
---|
[2715] | 91 | !!---------------------------------------------------------------------- |
---|
| 92 | ! |
---|
[6140] | 93 | ierr(:) = 0 |
---|
[10876] | 94 | ALLOCATE( uu (jpi,jpj,jpk,jpt) , vv (jpi,jpj,jpk,jpt) , & |
---|
| 95 | & ww (jpi,jpj,jpk) , hdiv(jpi,jpj,jpk) , & |
---|
| 96 | & ts (jpi,jpj,jpk,jpts,jpt), & |
---|
[10874] | 97 | & rab_b(jpi,jpj,jpk,jpts) , rab_n(jpi,jpj,jpk,jpts) , & |
---|
| 98 | & rn2b (jpi,jpj,jpk) , rn2 (jpi,jpj,jpk) , & |
---|
| 99 | & rhd (jpi,jpj,jpk) , rhop (jpi,jpj,jpk) , STAT=ierr(1) ) |
---|
[2715] | 100 | ! |
---|
[10919] | 101 | ALLOCATE( ssh(jpi,jpj,jpt) , uu_b(jpi,jpj,jpt) , vv_b(jpi,jpj,jpt) , & |
---|
[9019] | 102 | & spgu (jpi,jpj) , spgv(jpi,jpj) , & |
---|
| 103 | & gtsu(jpi,jpj,jpts), gtsv(jpi,jpj,jpts) , & |
---|
| 104 | & gru(jpi,jpj) , grv(jpi,jpj) , & |
---|
| 105 | & gtui(jpi,jpj,jpts), gtvi(jpi,jpj,jpts) , & |
---|
| 106 | & grui(jpi,jpj) , grvi(jpi,jpj) , & |
---|
| 107 | & riceload(jpi,jpj) , STAT=ierr(2) ) |
---|
[2715] | 108 | ! |
---|
[9019] | 109 | ALLOCATE( fraqsr_1lev(jpi,jpj) , STAT=ierr(3) ) |
---|
[3625] | 110 | ! |
---|
[6140] | 111 | ALLOCATE( ssha_e(jpi,jpj), sshn_e(jpi,jpj), sshb_e(jpi,jpj), sshbb_e(jpi,jpj), & |
---|
| 112 | & ua_e(jpi,jpj), un_e(jpi,jpj), ub_e(jpi,jpj), ubb_e(jpi,jpj), & |
---|
| 113 | & va_e(jpi,jpj), vn_e(jpi,jpj), vb_e(jpi,jpj), vbb_e(jpi,jpj), & |
---|
[9019] | 114 | & hu_e(jpi,jpj), hur_e(jpi,jpj), hv_e(jpi,jpj), hvr_e(jpi,jpj), STAT=ierr(4) ) |
---|
[6140] | 115 | ! |
---|
[9023] | 116 | ALLOCATE( ub2_b(jpi,jpj), vb2_b(jpi,jpj), un_bf(jpi,jpj), vn_bf(jpi,jpj) , STAT=ierr(6) ) |
---|
[6140] | 117 | #if defined key_agrif |
---|
[9019] | 118 | ALLOCATE( ub2_i_b(jpi,jpj), vb2_i_b(jpi,jpj) , STAT=ierr(6) ) |
---|
[6140] | 119 | #endif |
---|
| 120 | ! |
---|
[2715] | 121 | oce_alloc = MAXVAL( ierr ) |
---|
[10425] | 122 | IF( oce_alloc /= 0 ) CALL ctl_stop( 'STOP', 'oce_alloc: failed to allocate arrays' ) |
---|
[2715] | 123 | ! |
---|
| 124 | END FUNCTION oce_alloc |
---|
| 125 | |
---|
[1438] | 126 | !!====================================================================== |
---|
[3] | 127 | END MODULE oce |
---|