Changeset 1852 for LMDZ5/trunk/libf/bibio
- Timestamp:
- Aug 30, 2013, 10:47:10 AM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
LMDZ5/trunk/libf/bibio/wxios.F90
r1825 r1852 18 18 TYPE(xios_context), SAVE :: g_ctx 19 19 !$OMP THREADPRIVATE(g_comm,g_cts_name,g_ctx) 20 LOGICAL, SAVE :: g_flag_xml = .FALSE. 21 CHARACTER(len=100) :: g_field_name = "nofield" 22 !$OMP THREADPRIVATE(g_flag_xml,g_field_name) 23 20 24 21 25 CONTAINS … … 25 29 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 26 30 27 SUBROUTINE concat(str, i, str_i) !MAX i = 99 28 CHARACTER(len=*), INTENT(IN) :: str 29 INTEGER, INTENT(IN) :: i 30 CHARACTER(len=100), INTENT(OUT) :: str_i 31 32 33 !INT -> CHAR: 34 CHARACTER(len=10) :: num 35 WRITE(num, "(I5)") i 36 str_i = TRIM(ADJUSTL(str//"_"//TRIM(ADJUSTL(num)))) 37 31 SUBROUTINE concat(str, str2, str_str2) 32 CHARACTER(len=*), INTENT(IN) :: str, str2 33 CHARACTER(len=20), INTENT(OUT) :: str_str2 34 35 36 str_str2 = TRIM(ADJUSTL(str//"_"//TRIM(ADJUSTL(str2)))) 37 !IF (prt_level >= 10) WRITE(lunout,*) "Xios. ",str,"+",str2,"=",str_str2 38 38 END SUBROUTINE concat 39 39 … … 47 47 48 48 INTEGER :: i = 0 49 49 !!!!!!!!!!!!!!!!!! 50 ! Pour XIOS: 51 ! year : y 52 ! month : mo 53 ! day : d 54 ! hour : h 55 ! minute : mi 56 ! second : s 57 !!!!!!!!!!!!!!!!!! 58 50 59 i = INDEX(odate, "day") 51 60 IF (i > 0) THEN 52 61 ndate = odate(1:i-1)//"d" 53 ELSE 54 i = INDEX(odate, "hr") 55 IF (i > 0) THEN 56 ndate = odate(1:i-1)//"h" 57 ELSE 58 ndate = odate 59 END IF 60 END IF 61 62 !WRITE(*,*) "Xios. ", odate, " => ", ndate 62 END IF 63 64 i = INDEX(odate, "hr") 65 IF (i > 0) THEN 66 ndate = odate(1:i-1)//"h" 67 END IF 68 69 i = INDEX(odate, "mth") 70 IF (i > 0) THEN 71 ndate = odate(1:i-1)//"mo" 72 END IF 73 74 !IF (prt_level >= 10) WRITE(lunout,*) "Xios. ", odate, " => ", ndate 63 75 END SUBROUTINE reformadate 64 76 … … 89 101 END IF 90 102 91 ! WRITE(*,*) "Xios. ", op, " => ", reformaop103 !IF (prt_level >= 10) WRITE(lunout,*) "Xios. ", op, " => ", reformaop 92 104 END FUNCTION reformaop 93 105 … … 97 109 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 98 110 99 SUBROUTINE wxios_init(xios_ctx_name) 111 SUBROUTINE wxios_init(xios_ctx_name, locom, outcom) 112 IMPLICIT NONE 113 INCLUDE 'iniprint.h' 114 100 115 CHARACTER(len=*), INTENT(IN) :: xios_ctx_name 101 102 INTEGER :: xios_comm 116 INTEGER, INTENT(IN), OPTIONAL :: locom 117 INTEGER, INTENT(OUT), OPTIONAL :: outcom 118 119 103 120 TYPE(xios_context) :: xios_ctx 104 105 WRITE(*,*) "Xios. Initialization" 106 107 !Lancement de xios: 108 CALL xios_initialize(xios_ctx_name, return_comm = xios_comm ) 109 110 !Initialisation du contexte: 111 CALL xios_context_initialize(xios_ctx_name, xios_comm) 112 CALL xios_get_handle(xios_ctx_name, xios_ctx) !Récupération 113 CALL xios_set_current_context(xios_ctx) !Activation 121 INTEGER :: xios_comm 122 123 IF (prt_level >= 10) WRITE(lunout,*) "Xios. Initialization" 124 125 126 127 IF (PRESENT(locom)) THEN 128 IF (prt_level >= 10) WRITE(lunout,*) "Xios. ctx=",xios_ctx_name,"local_comm=",locom,",return_comm=",xios_comm 129 CALL xios_initialize(xios_ctx_name, local_comm = locom, return_comm = xios_comm ) 130 ELSE 131 IF (prt_level >= 10) WRITE(lunout,*) "Xios. ctx=",xios_ctx_name,"return_comm=",outcom 132 CALL xios_initialize(xios_ctx_name, return_comm = xios_comm ) 133 END IF 134 135 IF (PRESENT(outcom)) THEN 136 outcom = xios_comm 137 END IF 114 138 115 139 !Enregistrement des variables globales: 116 140 g_comm = xios_comm 117 141 g_ctx_name = xios_ctx_name 142 143 CALL wxios_context_init() 144 145 END SUBROUTINE wxios_init 146 147 SUBROUTINE wxios_context_init() 148 IMPLICIT NONE 149 INCLUDE 'iniprint.h' 150 151 TYPE(xios_context) :: xios_ctx 152 153 !Initialisation du contexte: 154 CALL xios_context_initialize(g_ctx_name, g_comm) 155 CALL xios_get_handle(g_ctx_name, xios_ctx) !Récupération 156 CALL xios_set_current_context(xios_ctx) !Activation 118 157 g_ctx = xios_ctx 119 120 WRITE(*,*) "Xios. Current context is ", xios_ctx_name 121 END SUBROUTINE wxios_init 158 159 IF (prt_level >= 10) WRITE(lunout,*) "Xios. Current context is ", g_ctx_name 160 161 !Une première analyse des héritages: 162 CALL xios_solve_inheritance() 163 END SUBROUTINE wxios_context_init 122 164 123 165 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! … … 126 168 127 169 SUBROUTINE wxios_set_cal(pasdetemps, calendrier, annee, mois, jour, heure) 170 IMPLICIT NONE 171 INCLUDE 'iniprint.h' 172 128 173 !Paramètres: 129 174 CHARACTER(len=*), INTENT(IN) :: calendrier … … 146 191 CASE('earth_360d') 147 192 CALL xios_set_context_attr_hdl(g_ctx, calendar_type= "D360") 148 WRITE(*,*) 'Xios. Calendrier terrestre a 360 jours/an'193 IF (prt_level >= 10) WRITE(lunout,*) 'Xios. Calendrier terrestre a 360 jours/an' 149 194 CASE('earth_365d') 150 195 CALL xios_set_context_attr_hdl(g_ctx, calendar_type= "NoLeap") 151 WRITE(*,*) 'Xios. Calendrier terrestre a 365 jours/an'196 IF (prt_level >= 10) WRITE(lunout,*) 'Xios. Calendrier terrestre a 365 jours/an' 152 197 CASE('earth_366d') 153 198 CALL xios_set_context_attr_hdl(g_ctx, calendar_type= "Gregorian") 154 WRITE(*,*) 'Xios. Calendrier gregorien'199 IF (prt_level >= 10) WRITE(lunout,*) 'Xios. Calendrier gregorien' 155 200 CASE DEFAULT 156 201 abort_message = 'Xios. Mauvais choix de calendrier' … … 161 206 WRITE(date, "(i4.4,'-',i2.2,'-',i2.2,' 00:00:00')") annee, mois, jour 162 207 163 WRITE(*,*) "Xios. Initial time: ", date208 IF (prt_level >= 10) WRITE(lunout,*) "Xios. Initial time: ", date 164 209 165 210 CALL xios_set_context_attr_hdl(g_ctx, start_date= date) … … 167 212 !Et enfin,le pas de temps: 168 213 CALL xios_set_timestep(mdtime) 169 WRITE(*,*) "Xios. ts=",mdtime214 IF (prt_level >= 10) WRITE(lunout,*) "Xios. ts=",mdtime 170 215 END SUBROUTINE wxios_set_cal 216 217 SUBROUTINE wxios_set_timestep(ts) 218 REAL, INTENT(IN) :: ts 219 TYPE(xios_time) :: mdtime 220 221 mdtime = xios_time(0, 0, 0, 0, 0, ts) 222 223 CALL xios_set_timestep(mdtime) 224 END SUBROUTINE wxios_set_timestep 171 225 172 226 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 173 227 ! Pour initialiser un domaine !!!!!!!!!!!!!!!!!!!! 174 228 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 175 SUBROUTINE wxios_domain_param(dom_id, is_sequential, iim, jjm, io_lat, io_lon) 229 SUBROUTINE wxios_domain_param(dom_id, is_sequential, ni, nj, ni_glo, nj_glo, & 230 ibegin, iend, ii_begin, ii_end, jbegin, jend, & 231 data_ni, data_ibegin, data_iend, & 232 io_lat, io_lon) 176 233 234 IMPLICIT NONE 235 INCLUDE 'iniprint.h' 236 177 237 CHARACTER (len=*), INTENT(IN) :: dom_id 178 238 LOGICAL, INTENT(IN) :: is_sequential 179 INTEGER, INTENT(IN) :: iim, jjm 239 INTEGER, INTENT(IN) :: ni, nj, ni_glo, nj_glo, ibegin, iend, ii_begin, ii_end, jbegin, jend 240 INTEGER, INTENT(IN) :: data_ni, data_ibegin, data_iend 180 241 REAL, DIMENSION(:) :: io_lat, io_lon 181 242 182 243 183 244 TYPE(xios_domain) :: dom 184 INTEGER :: ni, nj, ni_glo, nj_glo, ibegin, iend, jbegin, jend 185 LOGICAl :: boool 186 187 ni_glo = iim 188 nj_glo = jjm 189 ni = iim 190 nj = jjm 191 ibegin = 1 192 jbegin = 1 193 iend = ibegin + ni - 1 194 jend = jbegin + nj - 1 245 LOGICAL :: boool 246 247 !Masque pour les problèmes de recouvrement MPI: 248 LOGICAL :: mask(ni,nj) 195 249 196 250 !On récupère le handle: 197 251 CALL xios_get_domain_handle(dom_id, dom) 198 252 199 WRITE(*,*) "Xios. ni:",iim," ni_glo:", iim, " nj:", jjm, " nj_glo:", jjm 200 WRITE(*,*) "Xios. Size lon:", SIZE(io_lon), " lat:", SIZE(io_lat) 253 IF (prt_level >= 10) WRITE(lunout,*) "Xios. ni:",ni," ni_glo:", ni_glo, " nj:", nj, " nj_glo:", nj_glo 254 IF (prt_level >= 10) WRITE(lunout,*) "Xios. ibegin:",ibegin," iend:", iend, " jbegin:", jbegin, " jend:", jend 255 IF (prt_level >= 10) WRITE(lunout,*) "Xios. Size lon:", SIZE(io_lon(ibegin:iend)), " lat:", SIZE(io_lat(jbegin:jend)) 201 256 202 257 !On parametrise le domaine: 203 !IF (is_sequential) THEN 204 CALL xios_set_domain_attr_hdl(dom, ni_glo=iim, ibegin=1, ni=iim,& 205 & nj_glo=jjm, jbegin=1,nj=jjm,& 206 & lonvalue=io_lon(ibegin:iend), latvalue=io_lat(jbegin:jend)) 207 !END IF 258 CALL xios_set_domain_attr_hdl(dom, ni_glo=ni_glo, ibegin=ibegin, ni=ni) 259 CALL xios_set_domain_attr_hdl(dom, nj_glo=nj_glo, jbegin=jbegin, nj=nj, data_dim=2) 260 CALL xios_set_domain_attr_hdl(dom, lonvalue=io_lon(ibegin:iend), latvalue=io_lat(jbegin:jend)) 261 262 IF (.NOT.is_sequential) THEN 263 mask(:,:)=.TRUE. 264 mask(1:ii_begin-1,1) = .FALSE. 265 mask(ii_end+1:ni,nj) = .FALSE. 266 IF (prt_level >= 10) WRITE(lunout,*) "Xios. mask" 267 !CALL xios_set_domain_attr_hdl(dom, mask=mask) 268 END IF 269 208 270 CALL xios_is_defined_domain_attr_hdl(dom,ni_glo=boool) 209 271 !Vérification: 210 272 IF (xios_is_valid_domain(dom_id)) THEN 211 WRITE(*,*) "Xios. Domain initialized: ", dom_id, boool212 ELSE 213 WRITE(*,*) "Xios. Invalid domain: ", dom_id273 IF (prt_level >= 10) WRITE(lunout,*) "Xios. Domain initialized: ", dom_id, boool 274 ELSE 275 IF (prt_level >= 10) WRITE(lunout,*) "Xios. Invalid domain: ", dom_id 214 276 END IF 215 277 END SUBROUTINE wxios_domain_param … … 218 280 ! Pour déclarer un axe vertical !!!!!!!!!!!!!!! 219 281 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 220 SUBROUTINE wxios_add_vaxis(axisgroup_id, axis_file_id, axis_size, axis_value) 221 CHARACTER (len=*), INTENT(IN) :: axisgroup_id 222 INTEGER, INTENT(IN) :: axis_file_id, axis_size 282 SUBROUTINE wxios_add_vaxis(axisgroup_id, axis_file, axis_size, axis_value) 283 IMPLICIT NONE 284 INCLUDE 'iniprint.h' 285 286 CHARACTER (len=*), INTENT(IN) :: axisgroup_id, axis_file 287 INTEGER, INTENT(IN) :: axis_size 223 288 REAL, DIMENSION(axis_size), INTENT(IN) :: axis_value 224 289 225 290 TYPE(xios_axisgroup) :: axgroup 226 291 TYPE(xios_axis) :: ax 227 CHARACTER(len= 100) :: axis_id292 CHARACTER(len=20) :: axis_id 228 293 229 294 230 295 !Préparation du nom de l'axe: 231 CALL concat(axisgroup_id, axis_file _id, axis_id)296 CALL concat(axisgroup_id, axis_file, axis_id) 232 297 233 298 !On récupère le groupe d'axes qui va bien: … … 235 300 236 301 !On ajoute l'axe correspondant à ce fichier: 237 CALL xios_add_axis(axgroup, ax, axis_id)302 CALL xios_add_axis(axgroup, ax, TRIM(ADJUSTL(axis_id))) 238 303 239 304 !Et on le parametrise: … … 241 306 242 307 !Vérification: 243 IF (xios_is_valid_axis( axis_id)) THEN244 WRITE(*,*) "Xios. Axis created: ", axis_id245 ELSE 246 WRITE(*,*) "Xios. Invalid axis: ", axis_id308 IF (xios_is_valid_axis(TRIM(ADJUSTL(axis_id)))) THEN 309 IF (prt_level >= 10) WRITE(lunout,*) "Xios. Axis created: ", TRIM(ADJUSTL(axis_id)) 310 ELSE 311 WRITE(*,*) "Xios. Invalid axis: ", TRIM(ADJUSTL(axis_id)) 247 312 END IF 248 313 … … 254 319 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 255 320 SUBROUTINE wxios_add_file(fname, ffreq, flvl) 321 IMPLICIT NONE 322 INCLUDE 'iniprint.h' 323 256 324 CHARACTER(len=*), INTENT(IN) :: fname 257 325 CHARACTER(len=*), INTENT(IN) :: ffreq … … 262 330 CHARACTER(len=100) :: nffreq 263 331 264 !On créé le noeud: 265 CALL xios_get_filegroup_handle("defile", x_fg) 266 CALL xios_add_file(x_fg, x_file, "X"//fname) 267 268 !On reformate la fréquence: 269 CALL reformadate(ffreq, nffreq) 270 271 !On configure: 272 CALL xios_set_file_attr_hdl(x_file, name="X"//fname,& 332 !On regarde si le fichier n'est pas défini par XML: 333 IF (.NOT.xios_is_valid_file(fname)) THEN 334 !On créé le noeud: 335 CALL xios_get_filegroup_handle("defile", x_fg) 336 CALL xios_add_file(x_fg, x_file, fname) 337 338 !On reformate la fréquence: 339 CALL reformadate(ffreq, nffreq) 340 341 !On configure: 342 CALL xios_set_file_attr_hdl(x_file, name="X"//fname,& 273 343 output_freq=TRIM(ADJUSTL(nffreq)), output_level=flvl, enabled=.TRUE.) 274 344 275 IF (xios_is_valid_file("X"//fname)) THEN 276 WRITE(*,*) "Xios. New file: ", "X"//fname 277 WRITE(*,*) "Xios. output_freq=",TRIM(ADJUSTL(nffreq)),"; output_lvl=",flvl 278 ELSE 279 WRITE(*,*) "Xios. Error, invalid file: ", "X"//fname 280 WRITE(*,*) "Xios. output_freq=",TRIM(ADJUSTL(nffreq)),"; output_lvl=",flvl 345 IF (xios_is_valid_file("X"//fname)) THEN 346 IF (prt_level >= 10) WRITE(lunout,*) "Xios. New file: ", "X"//fname 347 IF (prt_level >= 10) WRITE(lunout,*) "Xios. output_freq=",TRIM(ADJUSTL(nffreq)),"; output_lvl=",flvl 348 ELSE 349 WRITE(*,*) "Xios. Error, invalid file: ", "X"//fname 350 WRITE(*,*) "Xios. output_freq=",TRIM(ADJUSTL(nffreq)),"; output_lvl=",flvl 351 END IF 352 ELSE 353 IF (prt_level >= 10) WRITE(lunout,*) "Xios. Fichier ", fname, " défini par XML." 354 CALL xios_set_file_attr(fname, enabled=.TRUE.) 281 355 END IF 282 356 END SUBROUTINE wxios_add_file 283 357 284 358 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 285 ! Pour créer un champ !!!!!!!!!!!!!!! 359 ! Pour créer un champ !!!!!!!!!!!!!!!!!!!! 286 360 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 287 361 SUBROUTINE wxios_add_field(fieldname, fieldgroup, fieldlongname, fieldunit) 288 362 USE netcdf 363 364 IMPLICIT NONE 365 INCLUDE 'iniprint.h' 289 366 290 367 CHARACTER(len=*), INTENT(IN) :: fieldname … … 308 385 !On ajoute le champ: 309 386 CALL xios_add_field(fieldgroup, field, fieldname) 310 ! WRITE(*,*) "Xios. ",fieldname,fieldgroup, fieldlongname, fieldunit387 !IF (prt_level >= 10) WRITE(lunout,*) "Xios. ",fieldname,fieldgroup, fieldlongname, fieldunit 311 388 312 389 !On rentre ses paramètres: 313 390 CALL xios_set_field_attr_hdl(field, standard_name=fieldlongname, unit=newunit, default_value=def) 314 WRITE(*,*) "Xios. Champ ", fieldname, "cree:"315 WRITE(*,*) "Xios. long_name=",fieldlongname,"; unit=",newunit,"; default_value=",nf90_fill_real391 IF (prt_level >= 10) WRITE(lunout,*) "Xios. Champ ", fieldname, "cree:" 392 IF (prt_level >= 10) WRITE(lunout,*) "Xios. long_name=",fieldlongname,"; unit=",newunit,"; default_value=",nf90_fill_real 316 393 317 394 END SUBROUTINE wxios_add_field 318 395 319 396 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 320 ! Pour déclarer un champ !!!!!!!!!!!!!!! 397 ! Pour déclarer un champ !!!!!!!!!!!!!!!!! 321 398 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 322 399 SUBROUTINE wxios_add_field_to_file(fieldname, fdim, fid, fname, fieldlongname, fieldunit, field_level, op) 400 IMPLICIT NONE 401 INCLUDE 'iniprint.h' 402 323 403 CHARACTER(len=*), INTENT(IN) :: fieldname 324 404 INTEGER, INTENT(IN) :: fdim, fid … … 329 409 CHARACTER(len=*), INTENT(IN) :: op 330 410 331 CHARACTER(len= 100) :: axis_id411 CHARACTER(len=20) :: axis_id 332 412 CHARACTER(len=100) :: operation 333 413 TYPE(xios_file) :: f 334 414 TYPE(xios_field) :: field 335 415 TYPE(xios_fieldgroup) :: fieldgroup 416 LOGICAL :: bool=.FALSE. 417 INTEGER :: lvl =0 336 418 337 419 338 420 !Préparation du nom de l'axe: 339 CALL concat("presnivs", f id, axis_id)421 CALL concat("presnivs", fname, axis_id) 340 422 341 423 !on prépare le nom de l'opération: … … 352 434 353 435 !On regarde si le champ à déjà été créé ou non: 354 IF (xios_is_valid_field(fieldname)) THEN 355 WRITE(*,*) "Xios. Champ ", fieldname, "existe" 356 ELSE 357 WRITE(*,*) "Xios. Champ ", fieldname, "nexiste pas" 436 IF (xios_is_valid_field(fieldname) .AND. .NOT. g_field_name == fieldname) THEN 437 !Si ce champ existe via XML (ie, dès le premier passage, ie g_field_name != fieldname) alors rien d'autre à faire 438 IF (prt_level >= 10) WRITE(lunout,*) "Xios. Champ ", fieldname, "existe via XML" 439 g_flag_xml = .TRUE. 440 g_field_name = fieldname 441 442 ELSE IF (.NOT. g_field_name == fieldname) THEN 443 !Si premier pssage et champ indéfini, alors on le créé 444 445 IF (prt_level >= 10) WRITE(lunout,*) "Xios. Champ ", fieldname, "nexiste pas" 358 446 359 447 !On le créé: 360 448 CALL wxios_add_field(fieldname, fieldgroup, fieldlongname, fieldunit) 361 449 IF (xios_is_valid_field(fieldname)) THEN 362 WRITE(*,*) "Xios. Champ ", fieldname, "cree"450 IF (prt_level >= 10) WRITE(lunout,*) "Xios. Champ ", fieldname, "cree" 363 451 ENDIF 364 ENDIF 365 366 !On ajoute le champ: 367 CALL xios_get_file_handle("X"//fname, f) 368 CALL xios_add_fieldtofile(f, field) 369 370 371 !L'operation, sa frequence: 372 CALL xios_set_field_attr_hdl(field, field_ref=fieldname, operation=TRIM(ADJUSTL(operation)), freq_op="1ts", prec=4) 373 374 375 !On rentre ses paramètres: 376 CALL xios_set_field_attr_hdl(field, level=field_level, enabled=.TRUE.) 377 378 IF (fdim.EQ.2) THEN 379 !Si c'est un champ 2D: 380 WRITE(*,*) "Xios. Champ 2D ", fieldname, " de ", "X"//fname ," configure:" 381 WRITE (*,*) "Xios. op=", TRIM(ADJUSTL(operation)) 382 WRITE(*,*) "Xios. freq_op=1ts","; lvl=",field_level 383 ELSE 384 !Si 3D : 385 !On ajoute l'axe vertical qui va bien: 386 CALL xios_set_field_attr_hdl(field, axis_ref=axis_id) 452 453 g_flag_xml = .FALSE. 454 g_field_name = fieldname 455 456 END IF 457 458 IF (.NOT. g_flag_xml) THEN 459 !Champ existe déjà, mais pas XML, alors on l'ajoute 460 !On ajoute le champ: 461 CALL xios_get_file_handle(fname, f) 462 CALL xios_add_fieldtofile(f, field) 387 463 388 WRITE(*,*) "Xios. Champ 3D ", fieldname, " de ", "X"//fname, "configure:" 389 WRITE(*,*) "Xios. freq_op=1ts","; lvl=",field_level 390 WRITE(*,*) "Xios. axe=",axis_id 391 END IF 464 465 !L'operation, sa frequence: 466 CALL xios_set_field_attr_hdl(field, field_ref=fieldname, operation=TRIM(ADJUSTL(operation)), freq_op="1ts", prec=4) 467 468 469 !On rentre ses paramètres: 470 CALL xios_set_field_attr_hdl(field, level=field_level, enabled=.TRUE.) 471 472 IF (fdim.EQ.2) THEN 473 !Si c'est un champ 2D: 474 IF (prt_level >= 10) WRITE(lunout,*) "Xios. Champ 2D ", fieldname, " de ", "X"//fname ," configure:" 475 IF (prt_level >= 10) WRITE(lunout,*) "Xios. op=", TRIM(ADJUSTL(operation)) 476 IF (prt_level >= 10) WRITE(lunout,*) "Xios. freq_op=1ts","; lvl=",field_level 477 ELSE 478 !Si 3D : 479 !On ajoute l'axe vertical qui va bien: 480 CALL xios_set_field_attr_hdl(field, axis_ref=TRIM(ADJUSTL(axis_id))) 481 482 IF (prt_level >= 10) WRITE(lunout,*) "Xios. Champ 3D ", fieldname, " de ", "X"//fname, "configure:" 483 IF (prt_level >= 10) WRITE(lunout,*) "Xios. freq_op=1ts","; lvl=",field_level 484 IF (prt_level >= 10) WRITE(lunout,*) "Xios. axe=",TRIM(ADJUSTL(axis_id)) 485 END IF 486 487 ELSE 488 !Sinon on se contente de l'activer: 489 CALL xios_set_field_attr(fieldname, enabled=.TRUE.) 490 ENDIF 392 491 393 492 END SUBROUTINE wxios_add_field_to_file … … 401 500 CHARACTER(len=*), INTENT(IN) :: fieldname 402 501 REAL, DIMENSION(:,:), INTENT(IN) :: fdata 403 502 404 503 CALL xios_send_field(fieldname, fdata) 405 504 END SUBROUTINE wxios_write_2D
Note: See TracChangeset
for help on using the changeset viewer.