- Timestamp:
- 2016-06-17T12:00:46+02:00 (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2016/dev_r6409_SIMPLIF_2_usrdef/NEMOGCM/NEMO/OPA_SRC/DOM/istate.F90
r6596 r6717 14 14 !! 3.3 ! 2010-10 (C. Ethe) merge TRC-TRA 15 15 !! 3.4 ! 2011-04 (G. Madec) Merge of dtatem and dtasal & suppression of tb,tn/sb,sn 16 !! 3.7 ! 2016-04 (S. Flavoni) change configuration's interface: 17 !! read file or CALL usr_def module to compute initial state (example given for GYRE) 16 !! 3.7 ! 2016-04 (S. Flavoni) introduce user defined initial state 18 17 !!---------------------------------------------------------------------- 19 18 … … 22 21 !! istate_uvg : initial velocity in geostropic balance 23 22 !!---------------------------------------------------------------------- 24 USE oce ! ocean dynamics and active tracers 25 USE dom_oce ! ocean space and time domain 26 USE c1d ! 1D vertical configuration 27 USE daymod ! calendar 28 USE eosbn2 ! eq. of state, Brunt Vaisala frequency (eos routine) 29 USE ldftra ! lateral physics: ocean active tracers 30 USE zdf_oce ! ocean vertical physics 31 USE phycst ! physical constants 32 USE dtatsd ! data temperature and salinity (dta_tsd routine) 33 USE dtauvd ! data: U & V current (dta_uvd routine) 23 USE oce ! ocean dynamics and active tracers 24 USE dom_oce ! ocean space and time domain 25 USE daymod ! calendar 26 USE divhor ! horizontal divergence (div_hor routine) 27 USE dtatsd ! data temperature and salinity (dta_tsd routine) 28 USE dtauvd ! data: U & V current (dta_uvd routine) 34 29 USE domvvl ! varying vertical mesh 35 30 USE iscplrst ! ice sheet coupling 36 USE usrdef ! User defined routine31 USE usrdef_istate ! User defined initial state 37 32 ! 38 33 USE in_out_manager ! I/O manager … … 47 42 48 43 PUBLIC istate_init ! routine called by step.F90 49 !SF PUBLIC ini_read ! subroutine ini_read50 44 51 45 !! * Substitutions … … 70 64 IF( nn_timing == 1 ) CALL timing_start('istate_init') 71 65 ! 66 IF(lwp) WRITE(numout,*) 67 IF(lwp) WRITE(numout,*) 'istate_init : Initialization of the dynamics and tracers' 68 IF(lwp) WRITE(numout,*) '~~~~~~~~~~~' 72 69 73 IF(lwp) WRITE(numout,*) 74 IF(lwp) WRITE(numout,*) 'istate_ini : Initialization of the dynamics and tracers' 75 IF(lwp) WRITE(numout,*) '~~~~~~~~~~' 76 77 !SF initialisation of T & S with data file 70 !!gm Why not include in the first call of dta_tsd ? 71 !!gm probably associated with the use of internal damping... 78 72 CALL dta_tsd_init ! Initialisation of T & S input data 79 IF( lk_c1d ) CALL dta_uvd_init ! Initialization of U & V input data 73 !!gm to be moved in usrdef of C1D case 74 ! IF( lk_c1d ) CALL dta_uvd_init ! Initialization of U & V input data 75 !!gm 80 76 81 77 rhd (:,:,: ) = 0._wp ; rhop (:,:,: ) = 0._wp ! set one for all to 0 at level jpk … … 87 83 ! ! ------------------- 88 84 CALL rst_read ! Read the restart file 89 IF (ln_iscpl) CALL iscpl_stp ! extra loate restart to wet and dry85 IF (ln_iscpl) CALL iscpl_stp ! extrapolate restart to wet and dry 90 86 CALL day_init ! model calendar (using both namelist and restart infos) 91 ELSE92 !! Start from rest87 ! 88 ELSE ! Start from rest 93 89 ! ! --------------- 94 90 numror = 0 ! define numror = 0 -> no restart file to read … … 96 92 CALL day_init ! model calendar (using both namelist and restart infos) 97 93 ! ! Initialization of ocean to zero 98 ! before fields ! now fields99 sshb (:,:) = 0._wp ; sshn (:,:) = 0._wp100 ub (:,:,:) = 0._wp ; un (:,:,:) = 0._wp101 vb (:,:,:) = 0._wp ; vn (:,:,:) = 0._wp102 hdivn(:,:,:) = 0._wp103 94 ! 104 IF( ln_tsd_init ) THEN ! read 3D T and S data at nit000 105 CALL dta_tsd( nit000, tsb ) 95 IF( ln_tsd_init ) THEN 96 CALL dta_tsd( nit000, tsb ) ! read 3D T and S data at nit000 97 ! 98 sshb(:,:) = 0._wp ! set the ocean at rest 99 ub (:,:,:) = 0._wp 100 vb (:,:,:) = 0._wp 101 ! 106 102 ELSE ! user defined initial T and S 107 CALL usr_def_i ni( tsb )103 CALL usr_def_istate( gdept_b, tmask, tsb, ub, vb, sshb ) 108 104 ENDIF 109 tsn(:,:,:,:) = tsb(:,:,:,:) ! set now to before values 105 tsn (:,:,:,:) = tsb (:,:,:,:) ! set now values from to before ones 106 sshn (:,:) = sshb(:,:) 107 un (:,:,:) = ub (:,:,:) 108 vn (:,:,:) = vb (:,:,:) 109 hdivn(:,:,jpk) = 0._wp ! bottom divergence set one for 0 to zero at jpk level 110 CALL div_hor( 0 ) ! compute interior hdivn value 111 !!gm hdivn(:,:,:) = 0._wp 112 113 !!gm POTENTIAL BUG : 114 !!gm ISSUE : if sshb /= 0 then, in non linear free surface, the e3._n, e3._b should be recomputed 115 !! as well as gdept and gdepw.... !!!!! 116 !! ===>>>> probably a call to domvvl initialisation here.... 117 118 110 119 ! 111 IF ( ln_uvd_init .AND. lk_c1d ) THEN ! read 3D U and V data at nit000 112 CALL wrk_alloc( jpi,jpj,jpk,2, zuvd ) 113 CALL dta_uvd( nit000, zuvd ) 114 ub(:,:,:) = zuvd(:,:,:,1) ; un(:,:,:) = ub(:,:,:) 115 vb(:,:,:) = zuvd(:,:,:,2) ; vn(:,:,:) = vb(:,:,:) 116 CALL wrk_dealloc( jpi,jpj,jpk,2, zuvd ) 117 ENDIF 120 !!gm to be moved in usrdef of C1D case 121 ! IF ( ln_uvd_init .AND. lk_c1d ) THEN ! read 3D U and V data at nit000 122 ! CALL wrk_alloc( jpi,jpj,jpk,2, zuvd ) 123 ! CALL dta_uvd( nit000, zuvd ) 124 ! ub(:,:,:) = zuvd(:,:,:,1) ; un(:,:,:) = ub(:,:,:) 125 ! vb(:,:,:) = zuvd(:,:,:,2) ; vn(:,:,:) = vb(:,:,:) 126 ! CALL wrk_dealloc( jpi,jpj,jpk,2, zuvd ) 127 ! ENDIF 118 128 ! 119 129 !!gm This is to be changed !!!! 120 ! - ML - sshn could be modified by istate_eel, so that initialization of e3t_b is done here121 IF( .NOT.ln_linssh ) THEN122 DO jk = 1, jpk123 e3t_b(:,:,jk) = e3t_n(:,:,jk)124 END DO125 ENDIF130 ! ! - ML - sshn could be modified by istate_eel, so that initialization of e3t_b is done here 131 ! IF( .NOT.ln_linssh ) THEN 132 ! DO jk = 1, jpk 133 ! e3t_b(:,:,jk) = e3t_n(:,:,jk) 134 ! END DO 135 ! ENDIF 126 136 !!gm 127 137 !
Note: See TracChangeset
for help on using the changeset viewer.