Changeset 6583 for branches/2016/dev_r6409_SIMPLIF_2_usrdef
- Timestamp:
- 2016-05-20T11:10:37+02:00 (8 years ago)
- Location:
- branches/2016/dev_r6409_SIMPLIF_2_usrdef/NEMOGCM/NEMO/OPA_SRC
- Files:
-
- 1 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2016/dev_r6409_SIMPLIF_2_usrdef/NEMOGCM/NEMO/OPA_SRC/SBC/sbc_oce.F90
r6140 r6583 30 30 !!---------------------------------------------------------------------- 31 31 ! !!* namsbc namelist * 32 LOGICAL , PUBLIC :: ln_ana !: analytical boundary condition flag33 LOGICAL , PUBLIC :: ln_flx !: flux formulation34 LOGICAL , PUBLIC :: ln_blk_clio !: CLIO bulk formulation35 LOGICAL , PUBLIC :: ln_blk_core !: CORE bulk formulation36 LOGICAL , PUBLIC :: ln_blk_mfs !: MFS bulk formulation32 LOGICAL , PUBLIC :: ln_ana !: user defined formulation 33 LOGICAL , PUBLIC :: ln_flx !: flux formulation 34 LOGICAL , PUBLIC :: ln_blk_clio !: CLIO bulk formulation 35 LOGICAL , PUBLIC :: ln_blk_core !: CORE bulk formulation 36 LOGICAL , PUBLIC :: ln_blk_mfs !: MFS bulk formulation 37 37 #if defined key_oasis3 38 38 LOGICAL , PUBLIC :: lk_oasis = .TRUE. !: OASIS used … … 72 72 !! switch definition (improve readability) 73 73 !!---------------------------------------------------------------------- 74 INTEGER , PUBLIC, PARAMETER :: jp_gyre = 0 !: GYRE analytical formulation 75 INTEGER , PUBLIC, PARAMETER :: jp_ana = 1 !: analytical formulation 74 INTEGER , PUBLIC, PARAMETER :: jp_ana = 1 !: user defined formulation 76 75 INTEGER , PUBLIC, PARAMETER :: jp_flx = 2 !: flux formulation 77 76 INTEGER , PUBLIC, PARAMETER :: jp_clio = 3 !: CLIO bulk formulation -
branches/2016/dev_r6409_SIMPLIF_2_usrdef/NEMOGCM/NEMO/OPA_SRC/SBC/sbcmod.F90
r6351 r6583 28 28 USE sbcdcy ! surface boundary condition: diurnal cycle 29 29 USE sbcssm ! surface boundary condition: sea-surface mean variables 30 USE sbcana ! surface boundary condition: analytical formulation31 30 USE sbcflx ! surface boundary condition: flux formulation 32 31 USE sbcblk_clio ! surface boundary condition: bulk formulation : CLIO … … 38 37 USE sbcice_cice ! surface boundary condition: CICE sea-ice model 39 38 USE sbccpl ! surface boundary condition: coupled florulation 39 USE usrdef_sbc ! user defined: surface boundary condition 40 40 USE cpl_oasis3 ! OASIS routines for coupling 41 41 USE sbcssr ! surface boundary condition: sea surface restoring … … 120 120 IF( lk_cice ) nn_ice = 4 121 121 ENDIF 122 IF( cp_cfg == 'gyre' ) THEN ! GYRE configuration123 ln_ana = .TRUE.124 nn_ice = 0125 ENDIF126 122 ! 127 123 IF(lwp) THEN ! Control print … … 129 125 WRITE(numout,*) ' frequency update of sbc (and ice) nn_fsbc = ', nn_fsbc 130 126 WRITE(numout,*) ' Type of air-sea fluxes : ' 131 WRITE(numout,*) ' analytical formulationln_ana = ', ln_ana132 WRITE(numout,*) ' flux formulationln_flx = ', ln_flx133 WRITE(numout,*) ' CLIO bulk formulationln_blk_clio = ', ln_blk_clio134 WRITE(numout,*) ' CORE bulk formulationln_blk_core = ', ln_blk_core135 WRITE(numout,*) ' MFS bulk formulationln_blk_mfs = ', ln_blk_mfs127 WRITE(numout,*) ' user defined formulation ln_ana = ', ln_ana 128 WRITE(numout,*) ' flux formulation ln_flx = ', ln_flx 129 WRITE(numout,*) ' CLIO bulk formulation ln_blk_clio = ', ln_blk_clio 130 WRITE(numout,*) ' CORE bulk formulation ln_blk_core = ', ln_blk_core 131 WRITE(numout,*) ' MFS bulk formulation ln_blk_mfs = ', ln_blk_mfs 136 132 WRITE(numout,*) ' Type of coupling (Ocean/Ice/Atmosphere) : ' 137 133 WRITE(numout,*) ' ocean-atmosphere coupled formulation ln_cpl = ', ln_cpl … … 160 156 SELECT CASE ( nn_limflx ) ! LIM3 Multi-category heat flux formulation 161 157 CASE ( -1 ) ; WRITE(numout,*) ' LIM3: use per-category fluxes (nn_limflx = -1) ' 162 CASE ( 0) ; WRITE(numout,*) ' LIM3: use average per-category fluxes (nn_limflx = 0) '163 CASE ( 1) ; WRITE(numout,*) ' LIM3: use average then redistribute per-category fluxes (nn_limflx = 1) '164 CASE ( 2) ; WRITE(numout,*) ' LIM3: Redistribute a single flux over categories (nn_limflx = 2) '158 CASE ( 0 ) ; WRITE(numout,*) ' LIM3: use average per-category fluxes (nn_limflx = 0) ' 159 CASE ( 1 ) ; WRITE(numout,*) ' LIM3: use average then redistribute per-category fluxes (nn_limflx = 1) ' 160 CASE ( 2 ) ; WRITE(numout,*) ' LIM3: Redistribute a single flux over categories (nn_limflx = 2) ' 165 161 END SELECT 166 162 ENDIF … … 224 220 ! 225 221 icpt = 0 226 IF( ln_ana ) THEN ; nsbc = jp_ana ; icpt = icpt + 1 ; ENDIF ! analyticalformulation222 IF( ln_ana ) THEN ; nsbc = jp_ana ; icpt = icpt + 1 ; ENDIF ! user defined formulation 227 223 IF( ln_flx ) THEN ; nsbc = jp_flx ; icpt = icpt + 1 ; ENDIF ! flux formulation 228 224 IF( ln_blk_clio ) THEN ; nsbc = jp_clio ; icpt = icpt + 1 ; ENDIF ! CLIO bulk formulation … … 230 226 IF( ln_blk_mfs ) THEN ; nsbc = jp_mfs ; icpt = icpt + 1 ; ENDIF ! MFS bulk formulation 231 227 IF( ll_purecpl ) THEN ; nsbc = jp_purecpl ; icpt = icpt + 1 ; ENDIF ! Pure Coupled formulation 232 IF( cp_cfg == 'gyre') THEN ; nsbc = jp_gyre ; ENDIF ! GYRE analytical formulation233 228 IF( nn_components == jp_iam_opa ) & 234 229 & THEN ; nsbc = jp_none ; icpt = icpt + 1 ; ENDIF ! opa coupling via SAS module … … 239 234 WRITE(numout,*) 240 235 SELECT CASE( nsbc ) 241 CASE( jp_gyre ) ; WRITE(numout,*) ' GYRE analytical formulation' 242 CASE( jp_ana ) ; WRITE(numout,*) ' analytical formulation' 236 CASE( jp_ana ) ; WRITE(numout,*) ' user defined formulation' 243 237 CASE( jp_flx ) ; WRITE(numout,*) ' flux formulation' 244 238 CASE( jp_clio ) ; WRITE(numout,*) ' CLIO bulk formulation' … … 337 331 SELECT CASE( nsbc ) ! Compute ocean surface boundary condition 338 332 ! ! (i.e. utau,vtau, qns, qsr, emp, sfx) 339 CASE( jp_gyre ) ; CALL sbc_gyre ( kt ) ! analytical formulation : GYRE configuration 340 CASE( jp_ana ) ; CALL sbc_ana ( kt ) ! analytical formulation : uniform sbc 333 CASE( jp_ana ) ; CALL usr_def_sbc ( kt ) ! user defined formulation 341 334 CASE( jp_flx ) ; CALL sbc_flx ( kt ) ! flux formulation 342 335 CASE( jp_clio ) ; CALL sbc_blk_clio( kt ) ! bulk formulation : CLIO for the ocean -
branches/2016/dev_r6409_SIMPLIF_2_usrdef/NEMOGCM/NEMO/OPA_SRC/usrdef.F90
r6579 r6583 2 2 !!============================================================================== 3 3 !! *** MODULE usrdef *** 4 !! User defined module: used like example to define init, sbc, bathy, ...4 !! User defined module: used like example to define domain, init, sbc, ... 5 5 !!============================================================================== 6 6 !! History : NEMO ! 2016-03 (S. Flavoni) … … 10 10 !! usr_def_hgr : initialize the horizontal mesh 11 11 !! usr_def_ini : initial state 12 !! usr_def_sbc : initialize the surface bounday conditions13 12 !!---------------------------------------------------------------------- 14 13 USE step_oce ! module used in the ocean time stepping module (step.F90) … … 29 28 CONTAINS 30 29 31 SUBROUTINE usr_def_hgr( nbench, jp_cfg, kff , pff , & ! Coriolis parameter (if domain not on the sphere)32 &pglamt, pglamu, pglamv , pglamf, & ! gridpoints position (required)33 &pgphit, pgphiu, pgphiv , pgphif, & !34 &pe1t , pe1u , pe1v , pe1f , & ! scale factors (required)35 &pe2t , pe2u , pe2v , pe2f , & !36 &ke1e2u_v ) ! u- & v-surfaces (if gridsize reduction is used in strait(s))37 !!---------------------------------------------------------------------- ---------------------------30 SUBROUTINE usr_def_hgr( kbench, k_cfg , kff , pff , & ! Coriolis parameter (if domain not on the sphere) 31 & pglamt, pglamu, pglamv , pglamf, & ! gridpoints position (required) 32 & pgphit, pgphiu, pgphiv , pgphif, & ! 33 & pe1t , pe1u , pe1v , pe1f , & ! scale factors (required) 34 & pe2t , pe2u , pe2v , pe2f , & ! 35 & ke1e2u_v ) ! u- & v-surfaces (if gridsize reduction is used in strait(s)) 36 !!---------------------------------------------------------------------- 38 37 !! *** ROUTINE usr_def_hgr *** 39 38 !! … … 52 51 !! - define i- & j-scale factors at t-, u-, v- and f-points (in meters) 53 52 !! - define u- & v-surfaces (if gridsize reduction is used in some straits) (in m2) 54 !!------------------------------------------------------------------------------------------------- 55 56 !!---------------------------------------------------------------------- 57 INTEGER , INTENT(in ) :: nbench, jp_cfg ! parameter of namelist for benchmark, and dimension of GYRE 58 INTEGER , INTENT( out) :: kff ! =1 Coriolis parameter computed here, =0 otherwise 59 REAL(wp), DIMENSION(:,:), INTENT( out) :: pff ! Coriolis factor at f-point [1/s] 53 !!---------------------------------------------------------------------- 54 INTEGER , INTENT(in ) :: kbench, k_cfg ! parameter of namelist for benchmark, and dimension of GYRE 55 INTEGER , INTENT( out) :: kff ! =1 Coriolis parameter computed here, =0 otherwise 56 REAL(wp), DIMENSION(:,:), INTENT( out) :: pff ! Coriolis factor at f-point [1/s] 60 57 REAL(wp), DIMENSION(:,:), INTENT( out) :: pglamt, pglamu, pglamv, pglamf ! longitude outputs [degrees] 61 58 REAL(wp), DIMENSION(:,:), INTENT( out) :: pgphit, pgphiu, pgphiv, pgphif ! latitude outputs [degrees] … … 76 73 IF(lwp) WRITE(numout,*) ' beta-plane with regular grid-spacing and rotated domain (GYRE configuration)' 77 74 ! 78 ! angle 45deg and ze1=106.e+3 / jp_cfg forced -> zlam1 = -85deg, zphi1 = 29degN75 ! angle 45deg and ze1=106.e+3 / k_cfg forced -> zlam1 = -85deg, zphi1 = 29degN 79 76 zlam1 = -85._wp 80 77 zphi1 = 29._wp 81 78 ! resolution in meters 82 ze1 = 106000. / REAL( jp_cfg , wp )79 ze1 = 106000. / REAL( k_cfg , wp ) 83 80 ! benchmark: forced the resolution to be about 100 km 81 IF( kbench /= 0 ) ze1 = 106000._wp 82 zsin_alpha = - SQRT( 2._wp ) * 0.5_wp 83 zcos_alpha = SQRT( 2._wp ) * 0.5_wp 84 ze1deg = ze1 / (ra * rad) 85 IF( kbench /= 0 ) ze1deg = ze1deg / REAL( jp_cfg , wp ) ! benchmark: keep the lat/+lon 86 ! ! at the right jp_cfg resolution 87 zlam0 = zlam1 + zcos_alpha * ze1deg * REAL( jpjglo-2 , wp ) 88 zphi0 = zphi1 + zsin_alpha * ze1deg * REAL( jpjglo-2 , wp ) 89 ! 90 IF( nprint==1 .AND. lwp ) THEN 91 WRITE(numout,*) ' ze1', ze1, 'cosalpha', zcos_alpha, 'sinalpha', zsin_alpha 92 WRITE(numout,*) ' ze1deg', ze1deg, 'zlam0', zlam0, 'zphi0', zphi0 93 ENDIF 94 ! 95 DO jj = 1, jpj 96 DO ji = 1, jpi 97 zim1 = REAL( ji + nimpp - 1 ) - 1. ; zim05 = REAL( ji + nimpp - 1 ) - 1.5 98 zjm1 = REAL( jj + njmpp - 1 ) - 1. ; zjm05 = REAL( jj + njmpp - 1 ) - 1.5 99 ! 100 !glamt(i,j) longitude at T-point 101 !gphit(i,j) latitude at T-point 102 pglamt(ji,jj) = zlam0 + zim05 * ze1deg * zcos_alpha + zjm05 * ze1deg * zsin_alpha 103 pgphit(ji,jj) = zphi0 - zim05 * ze1deg * zsin_alpha + zjm05 * ze1deg * zcos_alpha 104 ! 105 !glamu(i,j) longitude at U-point 106 !gphiu(i,j) latitude at U-point 107 pglamu(ji,jj) = zlam0 + zim1 * ze1deg * zcos_alpha + zjm05 * ze1deg * zsin_alpha 108 pgphiu(ji,jj) = zphi0 - zim1 * ze1deg * zsin_alpha + zjm05 * ze1deg * zcos_alpha 109 ! 110 !glamv(i,j) longitude at V-point 111 !gphiv(i,j) latitude at V-point 112 pglamv(ji,jj) = zlam0 + zim05 * ze1deg * zcos_alpha + zjm1 * ze1deg * zsin_alpha 113 pgphiv(ji,jj) = zphi0 - zim05 * ze1deg * zsin_alpha + zjm1 * ze1deg * zcos_alpha 114 ! 115 !glamf(i,j) longitude at F-point 116 !gphif(i,j) latitude at F-point 117 pglamf(ji,jj) = zlam0 + zim1 * ze1deg * zcos_alpha + zjm1 * ze1deg * zsin_alpha 118 pgphif(ji,jj) = zphi0 - zim1 * ze1deg * zsin_alpha + zjm1 * ze1deg * zcos_alpha 119 END DO 120 END DO 121 ! 122 ! !== Horizontal scale factors ==! (in meters) 123 ! 124 ! ! constant grid spacing 125 pe1t(:,:) = ze1 ; pe2t(:,:) = ze1 126 pe1u(:,:) = ze1 ; pe2u(:,:) = ze1 127 pe1v(:,:) = ze1 ; pe2v(:,:) = ze1 128 pe1f(:,:) = ze1 ; pe2f(:,:) = ze1 129 ! ! NO reduction of grid size in some straits 130 ke1e2u_v = 0 ! ==>> u_ & v_surfaces will be computed in dom_ghr routine 131 ! 132 ! 133 134 ! !== Coriolis parameter ==! 135 kff = 1 ! indicate not to compute ff afterward 136 ! 137 zbeta = 2. * omega * COS( rad * zphi1 ) / ra ! beta at latitude zphi1 138 !SF we overwrite zphi0 (south point in latitude) used just above to define pgphif (value of zphi0=15.5190567531966) 139 !SF for computation of coriolis we keep the parameter of Hazeleger, W., and S. S. Drijfhout, JPO 1998. 140 zphi0 = 15._wp ! latitude of the most southern grid point 141 zf0 = 2. * omega * SIN( rad * zphi0 ) ! compute f0 1st point south 142 ! 143 pff(:,:) = ( zf0 + zbeta * ABS( gphif(:,:) - zphi0 ) * rad * ra ) ! f = f0 +beta* y ( y=0 at south) 144 ! 145 IF(lwp) WRITE(numout,*) ' beta-plane used. beta = ', zbeta, ' 1/(s.m)' 146 ! 147 IF( nn_timing == 1 ) CALL timing_stop('usr_def_hgr') 84 148 ! 85 149 END SUBROUTINE usr_def_hgr … … 101 165 !! - set salinity field 102 166 !!---------------------------------------------------------------------- 103 REAL(wp), DIMENSION(jpi,jpj,jpk,jpts), INTENT( out) :: pts d! T & S data167 REAL(wp), DIMENSION(jpi,jpj,jpk,jpts), INTENT( out) :: pts ! T & S data 104 168 ! 105 169 INTEGER :: ji, jj, jk ! dummy loop indices
Note: See TracChangeset
for help on using the changeset viewer.