Changeset 28
- Timestamp:
- 07/27/07 15:20:37 (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/forcagequimarche.pro
r2 r28 1 PRO forcagequimarche,iyear,ian 2 @init2 3 @initorca2_bab 4 5 6 1 ; + 2 ; 3 ; @file_comments 4 ; calcul d'une matrice 3D de conductivité sigma=f(T,S) en fonction de T et S 5 ; de ORCA, sur la grille T 6 ; 7 ; @categories 8 ; orca grid 9 ; 10 ; @param orcares {in}{required}{type=string} 11 ; code of ORCA grid to use for output results 12 ; must be 'ORCA2' 13 ; 14 ; @param iyear {in}{required}{type=integer} 15 ; real year 16 ; 17 ; @param ian {in}{required}{type=integer} 18 ; simulation year 19 ; 20 ; @keyword DRAKKAR_EXP {type=string} 21 ; code for Drakkar experiment 22 ; only used when orcares = ORCA025 23 ; must be G42 ++ G70 24 ; 25 ; @restrictions 26 ; - Requires SAXO tools 27 ; 28 ; @todo 29 ; validation of ORCA2 processing (now some nan in output files !) 30 ; add ORCA025 31 ; provide tools to plot output files 32 ; produce a NetCDF GDT or CF compliant 33 ; 34 ; @pre 35 ; see geomag_profile.sh 36 ; be sure to have ++ in the directory defined in ${GEOMAG_ID}/ 37 ; 38 ; @post 39 ; see geomag_profile.sh 40 ; ++ in the directory defined in ${GEOMAG_OD}/ 41 ; 42 ; @examples 43 ; for ORCA2 44 ; IDL> .run forcagequimarche 45 ; IDL> forcagequimarche, 'ORCA2', '1993', '01' 46 ; 47 ; @history 48 ; fplod 2007-07-27T10:29:18Z cerbere.locean-ipsl.upmc.fr (Linux) 49 ; add orcares parameter 50 ; add optional keyword drakkar_exp 51 ; add header for idldoc 52 ; add check of io directories 53 ; replace io directories user dependant to $GEOMAG_ID and $GEOMAG_OD 54 ; replace call of divfred by call of div 55 ; 56 ; @version 57 ; $Id$ 58 ; 59 ;- 60 ; 61 PRO forcagequimarche,orcares,iyear,ian,DRAKKAR_EXP = drakkar_exp 62 ; 63 ;---- 64 ; check input parameters 65 ;---- 66 ; 67 ; check orcares definition 68 ; 69 CASE orcares OF 70 'ORCA2': BEGIN 71 msg = 'iii : valid orcares parameter = ' + orcares 72 ras = report(msg) 73 filename_oce = 'meshmask_bab.nc' 74 IF keyword_set(DRAKKAR_EXP) THEN BEGIN 75 msg = 'www : unused DRAKKAR_EXP keyword = ' + drakkar_exp 76 ras = report(msg) 77 END 78 END 79 ELSE : BEGIN 80 msg = 'eee : invalid orcares parameter = ' + orcares 81 ras = report(msg) 82 msg = 'eee : orcares must be ORCA2 or ORCA025++' 83 ras = report(msg) 84 RETURN 85 END 86 ENDCASE 87 88 ; ++ check iyear 89 ; ++ check ian 90 91 ;++@init2 92 ; init grid 93 initocemeshmask, orcares, DRAKKAR_EXP = drakkar_exp 7 94 8 95 @common 9 10 11 12 ;ian='01' 13 ;iyear='1993' 14 96 ; 97 ; check for input files 98 ; 99 ; test if ${GEOMAG_ID} defined 100 geomag_id_env=GETENV('GEOMAG_ID') 101 CASE geomag_id_env OF 102 '' : BEGIN 103 msg = 'eee : ${GEOMAG_ID} is not defined' 104 ras = report(msg) 105 RETURN 106 END 107 ELSE: BEGIN 108 msg = 'iii : ${GEOMAG_ID} is ' + geomag_id_env 109 ras = report(msg) 110 END 111 ENDCASE 112 ; 113 iodirin = isadirectory(geomag_id_env) 114 ; 115 ; existence and protection of ${GEOMAG_ID} 116 IF (FILE_TEST(iodirin, /DIRECTORY, /EXECUTABLE, /READ) EQ 0) THEN BEGIN 117 msg = 'eee : the directory' + iodirin + ' is not accessible.' 118 ras = report(msg) 119 RETURN 120 ENDIF 121 ; 122 ; test if ${GEOMAG_OD} defined 123 geomag_od_env=GETENV('GEOMAG_OD') 124 CASE geomag_od_env OF 125 '' : BEGIN 126 msg = 'eee : ${GEOMAG_OD} is not defined' 127 ras = report(msg) 128 RETURN 129 END 130 ELSE: BEGIN 131 msg = 'iii : ${GEOMAG_OD} is ' + geomag_od_env 132 ras = report(msg) 133 END 134 ENDCASE 135 ; 136 ; check if output data will be possible 137 iodirout = isadirectory(geomag_od_env) 138 ; 139 ; existence and protection 140 IF (FILE_TEST(iodirout, /DIRECTORY, /WRITE) EQ 0) THEN BEGIN 141 msg = 'eee : the directory' + iodirout + ' was not found.' 142 ras = report(msg) 143 RETURN 144 ENDIF 145 ; 15 146 e_exp='ESS' 16 rep_fred='/usr/work/sur/fvi/OPA/geomag/'17 147 key_portrait = 0 18 ; stockage des fichiers brut 19 ioDATA='/usr/work/sur/fvi/OPA/ORCA2/' 20 file_U=e_exp+'_5d_'+ian+'0101_'+ian+'1231_grid_U.nc' 21 print, file_U 22 file_V=e_exp+'_5d_'+ian+'0101_'+ian+'1231_grid_V.nc' 23 print, file_V 24 file_T=e_exp+'_5d_'+ian+'0101_'+ian+'1231_grid_T.nc' 25 print, file_T 26 file_Sed= rep_fred+'cond_sed_ORCA2.nc' 27 file_Br= rep_fred+'Br_ORCA2.nc' 28 29 148 ; stockage des fichiers brut 149 ioDATA=geomag_id_env 150 151 CASE orcares OF 152 'ORCA2': BEGIN 153 file_U=e_exp+'_5d_'+ian+'0101_'+ian+'1231_grid_U.nc' 154 file_V=e_exp+'_5d_'+ian+'0101_'+ian+'1231_grid_V.nc' 155 file_T=e_exp+'_5d_'+ian+'0101_'+ian+'1231_grid_T.nc' 156 file_Sed= geomag_id_env+'cond_sed_ORCA2.nc' 157 file_Br= geomag_id_env+'Br_ORCA2.nc' 158 END 159 ENDCASE 160 ; 30 161 ; title 31 162 t_exp= e_exp 32 ; t_exp0= e_exp033 163 t_bt = 'bar_transp' 34 ioORLN2 = '/usr/work/sur/fvi/OPA/ORCA2' 164 ioORLN2 = geomag_id_env 165 ; 35 166 ;facteur d'echelle vertical for partial steps 36 167 e3v3d=read_ncdf('e3v_ps',0,/timestep,iodir=ioORLN2,/nostruct,/tout,filename='meshmask_bab.nc') … … 39 170 ;BR=read_ncdf('Br',0,/timestep,/nostruct,/tout,filename=file_Br) 40 171 BR=read_ncdf('Br',0,/timestep,/nostruct,/tout,filename=file_Br,/cont_nofill) 41 42 43 44 172 ; 45 173 ; vertical integration: 46 e3t3d=make_array(jpi,jpj,jpk) 174 e3t3d=make_array(jpi,jpj,jpk) 47 175 for k=0, jpk-1 do begin &$ 48 for j=0,jpj-1 do begin &$ 176 for j=0,jpj-1 do begin &$ 49 177 for i=0,jpi-1 do begin &$ 50 178 e3t3d(i,j,k) = e3t(k) &$ … … 53 181 endfor 54 182 jpt = 73 55 56 ;vud = make_array(jpi,jpj,jpt) 183 ; 184 ;vud = make_array(jpi,jpj,jpt) 57 185 ;vvd = make_array(jpi, jpj, jpt) 58 186 divBustar = make_array(jpi, jpj, jpt) 59 187 diver3=replicate(0.,182,149,1,73) 60 188 sigma3=replicate(0.,182,149,1,73) 61 62 63 FOR jt = 0, jpt-1 DO BEGIN &$ 64 189 ; 190 FOR jt = 0, jpt-1 DO BEGIN &$ 191 ; 65 192 ; ouverture des fichiers et stockage en memoire partial steps 66 vu=read_ncdf('vozocrtx',jt,jt, /timestep, iodir=ioDATA,/nostruct,/TOUT,filename=file_U) &$ 67 ;stop 68 vv=read_ncdf('vomecrty',jt,jt, /timestep,iodir=ioDATA,/nostruct,/TOUT,filename=file_V) &$ 193 vu=read_ncdf('vozocrtx',jt,jt, /timestep, iodir=ioDATA,/nostruct,/TOUT,filename=file_U) &$ 194 ;stop 195 vv=read_ncdf('vomecrty',jt,jt, /timestep,iodir=ioDATA,/nostruct,/TOUT,filename=file_V) &$ 69 196 ;stop 70 197 ; lecture salinite & temperature … … 77 204 conduct(mask_t)=0. 78 205 ; Somme conduct au point T 79 80 206 ; 81 207 ; Calcul SIGMA 82 208 ; 83 209 SIGMAoc=total(conduct*e3t3d*tmask,3) 84 210 SIGMA=SIGMAsed+SIGMAoc 85 86 87 211 ; 88 212 SIGMA_u=(SIGMA+shift(SIGMA,-1,0))/2. 89 90 213 SIGMA_v=(SIGMA+shift(SIGMA,0,1))/2. 91 214 ; 92 215 ; Calcul B en points u et v 93 216 ; 94 217 BR_u=(BR+shift(BR,-1,0))/2. 95 96 218 BR_v=(BR+shift(BR,0,1))/2. 97 98 219 ; 99 220 ; Calcul integrale conduct 100 221 ; 101 222 conduct_u=(conduct+shift(conduct,-1,0,0))/2. 102 103 223 conduct_v=(conduct+shift(conduct,0,1,0))/2. 104 224 ; 105 225 u_cond_u=total( vu*conduct_u*e3u3d*umask(),3) 106 107 226 v_cond_v=total( vv*conduct_v*e3v3d*vmask(),3) 108 109 227 ; 110 228 Bu_star= BR_u*u_cond_u/SIGMA_u 111 112 229 Bv_star= BR_v*v_cond_v/SIGMA_v 113 230 ; 114 231 ; Divergence du champ 115 116 Diver=divfred(Bu_star,Bv_star) 232 Diver=div(Bu_star,Bv_star) 117 233 118 234 Diver=Diver*1e-6 … … 120 236 lecontinent=where(Diver GT 1.E08) 121 237 Diver(lecontinent)=0. 122 123 124 238 125 239 ;stop … … 134 248 sigma3(181,*,*,*)=sigma3(1,*,*,*) 135 249 136 137 250 print, jt 138 251 139 140 ENDFOR 252 ENDFOR 141 253 ; on ferme le NetCDF 142 254 ;NCDF_CLOSE,id3 143 255 ;NCDF_CLOSE,id4 144 145 146 147 256 148 257 temps=fltarr(73) … … 154 263 155 264 vargrid = 'T' 156 iodir = '/usr/work/sur/fvi/OPA/ORCA2/'265 iodir = geomag_od_env 157 266 ; Nom 158 267 idout = NCDF_CREATE(iodir+'DivBustar_5d_'+iyear+'_grid_T.nc',/clobber) … … 203 312 ; Creation de la latitude 204 313 NCDF_VARPUT, idout, id1, gphit 205 ; Creation de la profondeur 206 NCDF_VARPUT, idout, id2, gdept 314 ; Creation de la profondeur 315 NCDF_VARPUT, idout, id2, gdept 207 316 ; Creation du calendrier 208 317 209 318 NCDF_VARPUT, idout, id3, temps 210 319 211 320 212 321 ; Ecriture des donnees 213 322 214 ; ecriture des glam_8 323 ; ecriture des glam_8 215 324 NCDF_VARPUT, idout, id4 , diver3 216 325 … … 267 376 ; Creation de la latitude 268 377 NCDF_VARPUT, idout, id1, gphit 269 ; Creation de la profondeur 270 NCDF_VARPUT, idout, id2, gdept 378 ; Creation de la profondeur 379 NCDF_VARPUT, idout, id2, gdept 271 380 ; Creation du calendrier 272 381 273 382 NCDF_VARPUT, idout, id3, temps 274 383 275 384 276 385 ; Ecriture des donnees 277 386 278 ; ecriture des glam_8 387 ; ecriture des glam_8 279 388 NCDF_VARPUT, idout, id4 , sigma3 280 389
Note: See TracChangeset
for help on using the changeset viewer.