[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 | |
---|
[10743] | 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] |
---|
[10789] | 22 | REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:), TARGET :: ww !: vertical velocity [m/s] |
---|
[10364] | 23 | REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: wi !: vertical vel. (adaptive-implicit) [m/s] |
---|
[5836] | 24 | REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: hdivn !: horizontal divergence [s-1] |
---|
[10802] | 25 | REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:,:,:), TARGET :: ts !: 4D T-S fields [Celsius,psu] |
---|
[7646] | 26 | REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:,:) :: rab_b, rab_n !: thermal/haline expansion coef. [Celsius-1,psu-1] |
---|
[4990] | 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 ! |
---|
| 35 | REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: ub_b , un_b , ua_b !: Barotropic velocities at u-point [m/s] |
---|
| 36 | REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: vb_b , vn_b , va_b !: Barotropic velocities at v-point [m/s] |
---|
| 37 | REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: sshb , sshn , ssha !: sea surface height at t-point [m] |
---|
[359] | 38 | |
---|
[6140] | 39 | !! Arrays at barotropic time step: ! befbefore! before ! now ! after ! |
---|
| 40 | REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: ubb_e , ub_e , un_e , ua_e !: u-external velocity |
---|
| 41 | REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: vbb_e , vb_e , vn_e , va_e !: v-external velocity |
---|
| 42 | REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: sshbb_e, sshb_e, sshn_e, ssha_e !: external ssh |
---|
| 43 | REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: hu_e !: external u-depth |
---|
| 44 | REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: hv_e !: external v-depth |
---|
| 45 | REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: hur_e !: inverse of u-depth |
---|
| 46 | REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: hvr_e !: inverse of v-depth |
---|
| 47 | REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: ub2_b , vb2_b !: Half step fluxes (ln_bt_fw=T) |
---|
[9023] | 48 | REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: un_bf , vn_bf !: Asselin filtered half step fluxes (ln_bt_fw=T) |
---|
[5930] | 49 | #if defined key_agrif |
---|
[6140] | 50 | REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: ub2_i_b, vb2_i_b !: Half step time integrated fluxes |
---|
[5930] | 51 | #endif |
---|
[6140] | 52 | ! |
---|
| 53 | REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: spgu, spgv !: horizontal surface pressure gradient |
---|
[5930] | 54 | |
---|
[2528] | 55 | !! interpolated gradient (only used in zps case) |
---|
| 56 | !! --------------------- |
---|
[2715] | 57 | REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: gtsu, gtsv !: horizontal gradient of T, S bottom u-point |
---|
| 58 | REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: gru , grv !: horizontal gradient of rd at bottom u-point |
---|
[2528] | 59 | |
---|
[4990] | 60 | !! (ISF) interpolated gradient (only used for ice shelf case) |
---|
| 61 | !! --------------------- |
---|
| 62 | REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: gtui, gtvi !: horizontal gradient of T, S and rd at top u-point |
---|
| 63 | REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: grui, grvi !: horizontal gradient of T, S and rd at top v-point |
---|
| 64 | !! (ISF) ice load |
---|
| 65 | REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: riceload |
---|
| 66 | |
---|
| 67 | !! Energy budget of the leads (open water embedded in sea ice) |
---|
| 68 | REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: fraqsr_1lev !: fraction of solar net radiation absorbed in the first ocean level [-] |
---|
[4205] | 69 | |
---|
[10743] | 70 | !! TEMPORARY POINTERS FOR DEVELOPMENT ONLY |
---|
| 71 | REAL(wp), PUBLIC, POINTER, SAVE, DIMENSION(:,:,:) :: ub , un , ua !: i-horizontal velocity [m/s] |
---|
| 72 | REAL(wp), PUBLIC, POINTER, SAVE, DIMENSION(:,:,:) :: vb , vn , va !: j-horizontal velocity [m/s] |
---|
[10789] | 73 | REAL(wp), PUBLIC, POINTER, SAVE, DIMENSION(:,:,:) :: wn !: k-vertical velocity [m/s] |
---|
[10802] | 74 | REAL(wp), PUBLIC, POINTER, SAVE, DIMENSION(:,:,:,:) :: tsb , tsn , tsa !: 4D T-S fields [Celsius,psu] |
---|
| 75 | !! TEMPORARY POINTERS FOR DEVELOPMENT ONLY |
---|
[10743] | 76 | |
---|
[3] | 77 | !!---------------------------------------------------------------------- |
---|
[9598] | 78 | !! NEMO/OCE 4.0 , NEMO Consortium (2018) |
---|
[1438] | 79 | !! $Id$ |
---|
[10068] | 80 | !! Software governed by the CeCILL license (see ./LICENSE) |
---|
[2715] | 81 | !!---------------------------------------------------------------------- |
---|
| 82 | CONTAINS |
---|
| 83 | |
---|
| 84 | INTEGER FUNCTION oce_alloc() |
---|
| 85 | !!---------------------------------------------------------------------- |
---|
| 86 | !! *** FUNCTION oce_alloc *** |
---|
| 87 | !!---------------------------------------------------------------------- |
---|
[9019] | 88 | INTEGER :: ierr(6) |
---|
[2715] | 89 | !!---------------------------------------------------------------------- |
---|
| 90 | ! |
---|
[6140] | 91 | ierr(:) = 0 |
---|
[10743] | 92 | ALLOCATE( uu (jpi,jpj,jpk, jpt) , vv (jpi,jpj,jpk,jpt) , & |
---|
[10789] | 93 | & ww (jpi,jpj,jpk) , hdivn(jpi,jpj,jpk) , & |
---|
[10802] | 94 | & ts (jpi,jpj,jpk,jpts,jpt) , & |
---|
[4990] | 95 | & rab_b(jpi,jpj,jpk,jpts) , rab_n(jpi,jpj,jpk,jpts) , & |
---|
[5836] | 96 | & rn2b (jpi,jpj,jpk) , rn2 (jpi,jpj,jpk) , & |
---|
| 97 | & rhd (jpi,jpj,jpk) , rhop (jpi,jpj,jpk) , STAT=ierr(1) ) |
---|
[2715] | 98 | ! |
---|
[9019] | 99 | ALLOCATE( sshb(jpi,jpj) , sshn(jpi,jpj) , ssha(jpi,jpj) , & |
---|
| 100 | & ub_b(jpi,jpj) , un_b(jpi,jpj) , ua_b(jpi,jpj) , & |
---|
| 101 | & vb_b(jpi,jpj) , vn_b(jpi,jpj) , va_b(jpi,jpj) , & |
---|
| 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 |
---|