Changeset 14995 for NEMO/trunk/tests/ISOMIP+/MY_SRC/istate.F90
- Timestamp:
- 2021-06-15T19:15:26+02:00 (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
NEMO/trunk/tests/ISOMIP+/MY_SRC/istate.F90
r14857 r14995 34 34 USE lib_mpp ! MPP library 35 35 USE restart ! restart 36 36 37 #if defined key_agrif 38 USE agrif_oce ! initial state interpolation 37 39 USE agrif_oce_interp 38 USE agrif_oce39 40 #endif 40 41 … … 42 43 PRIVATE 43 44 44 PUBLIC istate_init ! routine called by step.F9045 PUBLIC istate_init ! routine called by nemogcm.F90 45 46 46 47 !! * Substitutions … … 63 64 ! 64 65 INTEGER :: ji, jj, jk ! dummy loop indices 65 REAL(wp), DIMENSION(jpi,jpj,jpk) :: zgdept ! 3D table !!st patch to use gdept subtitute66 REAL(wp), DIMENSION(jpi,jpj,jpk) :: zgdept ! 3D table for qco substitute 66 67 !!gm see comment further down 67 68 REAL(wp), ALLOCATABLE, DIMENSION(:,:,:,:) :: zuvd ! U & V data workspace … … 73 74 IF(lwp) WRITE(numout,*) '~~~~~~~~~~~' 74 75 75 !!gm Why not include in the first call of dta_tsd ?76 !!gm probably associated with the use of internal damping...77 76 CALL dta_tsd_init ! Initialisation of T & S input data 78 !!gm to be moved in usrdef of C1D case 77 79 78 ! IF( lk_c1d ) CALL dta_uvd_init ! Initialization of U & V input data 80 !!gm81 79 82 rhd (:,:,: ) = 0._wp ; rhop (:,:,: ) = 0._wp ! set one for all to 0 at level jpk83 rn2b (:,:,: ) = 0._wp ; rn2 (:,:,: ) = 0._wp ! set one for all to 0 at levels 1 and jpk84 ts (:,:,:,:,Kaa) = 0._wp ! set one for all to 0 at level jpk85 rab_b(:,:,:,: ) = 0._wp ; rab_n(:,:,:,:) = 0._wp ! set one for all to 0 at level jpk80 rhd (:,:,: ) = 0._wp ; rhop (:,:,: ) = 0._wp ! set one for all to 0 at level jpk 81 rn2b (:,:,: ) = 0._wp ; rn2 (:,:,: ) = 0._wp ! set one for all to 0 at levels 1 and jpk 82 ts (:,:,:,:,Kaa) = 0._wp ! set one for all to 0 at level jpk 83 rab_b(:,:,:,: ) = 0._wp ; rab_n(:,:,:,:) = 0._wp ! set one for all to 0 at level jpk 86 84 #if defined key_agrif 87 85 uu (:,:,: ,Kaa) = 0._wp ! used in agrif_oce_sponge at initialization … … 94 92 ln_1st_euler = .true. ! Set time-step indicator at nit000 (euler forward) 95 93 CALL day_init 96 CALL agrif_istate ( Kbb, Kmm, Kaa ) ! Interp from parent94 CALL agrif_istate_oce( Kbb, Kmm, Kaa ) ! Interp from parent 97 95 ! 98 ts (:,:,:,:,Kmm) = ts (:,:,:,:,Kbb) 99 ssh (:,:,Kmm) = ssh(:,:,Kbb) 100 uu (:,:,:,Kmm) = uu (:,:,:,Kbb) 101 vv (:,:,:,Kmm) = vv (:,:,:,Kbb) 96 ts (:,:,:,:,Kmm) = ts (:,:,:,:,Kbb) 97 uu (:,:,: ,Kmm) = uu (:,:,: ,Kbb) 98 vv (:,:,: ,Kmm) = vv (:,:,: ,Kbb) 102 99 ELSE 103 100 #endif 104 IF( ln_rstart ) THEN ! Restart from a file 105 ! ! ------------------- 106 CALL rst_read( Kbb, Kmm ) ! Read the restart file 107 CALL day_init ! model calendar (using both namelist and restart infos) 108 ! 109 ELSE ! Start from rest 110 ! ! --------------- 111 numror = 0 ! define numror = 0 -> no restart file to read 112 l_1st_euler = .true. ! Set time-step indicator at nit000 (euler forward) 113 CALL day_init ! model calendar (using both namelist and restart infos) 114 ! ! Initialization of ocean to zero 115 ! 116 IF( ln_tsd_init ) THEN 117 CALL dta_tsd( nit000, 'ini', ts(:,:,:,:,Kbb) ) ! read 3D T and S data at nit000 101 IF( ln_rstart ) THEN ! Restart from a file 102 ! ! ------------------- 103 CALL rst_read( Kbb, Kmm ) ! Read the restart file 104 CALL day_init ! model calendar (using both namelist and restart infos) 118 105 ! 119 uu (:,:,:,Kbb) = 0._wp 120 vv (:,:,:,Kbb) = 0._wp 106 ELSE ! Start from rest 107 ! ! --------------- 108 numror = 0 ! define numror = 0 -> no restart file to read 109 l_1st_euler = .true. ! Set time-step indicator at nit000 (euler forward) 110 CALL day_init ! model calendar (using both namelist and restart infos) 111 ! ! Initialization of ocean to zero 121 112 ! 122 ELSE ! user defined initial T and S123 DO jk = 1, jpk124 zgdept(:,:,jk) = gdept(:,:,jk,Kbb)125 END DO126 CALL usr_def_istate( zgdept, tmask, ts(:,:,:,:,Kbb), uu(:,:,:,Kbb), vv(:,:,:,Kbb) )127 ENDIF128 ts (:,:,:,:,Kmm) = ts (:,:,:,:,Kbb) ! set now values from to before ones129 uu (:,:,:,Kmm) = uu (:,:,:,Kbb)130 vv (:,:,:,Kmm) = vv (:,:,:,Kbb)131 132 !!gm POTENTIAL BUG : 133 !!gm ISSUE : if ssh(:,:,Kbb) /= 0 then, in non linear free surface, the e3._n, e3._b should be recomputed 134 !! as well as gdept_ and gdepw_.... !!!!! 135 !! ===>>>> probably a call to domvvl initialisation here.... 136 113 IF( ln_tsd_init ) THEN 114 CALL dta_tsd( nit000, 'ini', ts(:,:,:,:,Kbb) ) ! read 3D T and S data at nit000 115 ! 116 uu (:,:,:,Kbb) = 0._wp ! set the ocean at rest 117 vv (:,:,:,Kbb) = 0._wp 118 ! 119 ELSE ! user defined initial T and S 120 DO jk = 1, jpk 121 zgdept(:,:,jk) = gdept(:,:,jk,Kbb) 122 END DO 123 CALL usr_def_istate( zgdept, tmask, ts(:,:,:,:,Kbb), uu(:,:,:,Kbb), vv(:,:,:,Kbb) ) 124 ENDIF 125 ts (:,:,:,:,Kmm) = ts (:,:,:,:,Kbb) ! set now values from to before ones 126 uu (:,:,:,Kmm) = uu (:,:,:,Kbb) 127 vv (:,:,:,Kmm) = vv (:,:,:,Kbb) 137 128 138 129 ! 139 !!gm to be moved in usrdef of C1D case140 !IF ( ln_uvd_init .AND. lk_c1d ) THEN ! read 3D U and V data at nit000141 !ALLOCATE( zuvd(jpi,jpj,jpk,2) )142 ! CALL dta_uvd( nit000, zuvd )143 ! uu(:,:,:,Kbb) = zuvd(:,:,:,1); uu(:,:,:,Kmm) = uu(:,:,:,Kbb)144 ! vv(:,:,:,Kbb) = zuvd(:,:,:,2); vv(:,:,:,Kmm) = vv(:,:,:,Kbb)145 !DEALLOCATE( zuvd )146 !ENDIF130 !!gm ==>>> to be moved in usrdef_istate of C1D case 131 IF ( ln_uvd_init .AND. lk_c1d ) THEN ! read 3D U and V data at nit000 132 ALLOCATE( zuvd(jpi,jpj,jpk,2) ) 133 CALL dta_uvd( nit000, Kbb, zuvd ) 134 uu(:,:,:,Kbb) = zuvd(:,:,:,1) ; uu(:,:,:,Kmm) = uu(:,:,:,Kbb) 135 vv(:,:,:,Kbb) = zuvd(:,:,:,2) ; vv(:,:,:,Kmm) = vv(:,:,:,Kbb) 136 DEALLOCATE( zuvd ) 137 ENDIF 147 138 ! 148 !!gm This is to be changed !!!!149 ! ! - ML - ssh(:,:,Kmm) could be modified by istate_eel, so that initialization of e3t(:,:,:,Kbb) is done here150 ! IF( .NOT.ln_linssh ) THEN151 ! DO jk = 1, jpk152 ! e3t(:,:,jk,Kbb) = e3t(:,:,jk,Kmm)153 ! END DO154 ! ENDIF155 !!gm156 139 ! 157 ENDIF140 ENDIF 158 141 #if defined key_agrif 159 142 ENDIF
Note: See TracChangeset
for help on using the changeset viewer.