- Timestamp:
- Jul 5, 2023, 11:35:57 AM (17 months ago)
- Location:
- LMDZ6/trunk/libf
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
LMDZ6/trunk/libf/misc/wxios.F90
r4477 r4606 159 159 g_ctx = xios_ctx 160 160 161 CALL wxios_add_group_init 162 161 163 IF (prt_level >= 10) THEN 162 164 WRITE(lunout,*) "wxios_context_init: Current context is ",trim(g_ctx_name) … … 168 170 END SUBROUTINE wxios_context_init 169 171 172 173 174 SUBROUTINE wxios_add_group_init 175 176 ! routine create by Anne Cozic (2023) 177 ! This routine will create field associated to group defined without description of fields in field.xml file 178 ! This routine need to be call before "xios_sole_inheritance" after an !$OMP MASTER directive 179 180 USE infotrac_phy, ONLY: nbtr, nqtot, nqo, type_trac, tracers, niso, ntiso 181 USE strings_mod, ONLY: maxlen 182 183 IMPLICIT NONE 184 185 TYPE(xios_fieldgroup) :: group_handle 186 TYPE(xios_field) :: child 187 INTEGER :: k, iq 188 CHARACTER(len=12) :: nvar 189 CHARACTER(LEN=maxlen) :: varname, dn 190 CHARACTER(LEN=maxlen) :: unt 191 192 193 ! group create for StratAER variables 194 !On ajoute les variables 3D traceurs par l interface fortran 195 CALL xios_get_handle("fields_strataer_trac_3D", group_handle) 196 ! On boucle sur les traceurs pour les ajouter au groupe puis fixer les attributs 197 DO iq = 1, nqtot 198 IF(.NOT.(tracers(iq)%isAdvected .AND. tracers(iq)%isInPhysics)) CYCLE 199 dn = 'd'//TRIM(tracers(iq)%name)//'_' 200 201 unt = "kg kg-1" 202 varname=trim(tracers(iq)%name) 203 CALL xios_add_child(group_handle, child, varname) 204 CALL xios_set_attr(child, name=varname, unit=unt) 205 206 unt = "kg kg-1 s-1" 207 varname=TRIM(dn)//'vdf' 208 CALL xios_add_child(group_handle, child, varname) 209 CALL xios_set_attr(child, name=varname, unit=unt) 210 varname=TRIM(dn)//'the' 211 CALL xios_add_child(group_handle, child, varname) 212 CALL xios_set_attr(child, name=varname, unit=unt) 213 varname=TRIM(dn)//'con' 214 CALL xios_add_child(group_handle, child, varname) 215 CALL xios_set_attr(child, name=varname, unit=unt) 216 varname=TRIM(dn)//'lessi_impa' 217 CALL xios_add_child(group_handle, child, varname) 218 CALL xios_set_attr(child, name=varname, unit=unt) 219 varname=TRIM(dn)//'lessi_nucl' 220 CALL xios_add_child(group_handle, child, varname) 221 CALL xios_set_attr(child, name=varname, unit=unt) 222 varname=TRIM(dn)//'insc' 223 CALL xios_add_child(group_handle, child, varname) 224 CALL xios_set_attr(child, name=varname, unit=unt) 225 varname=TRIM(dn)//'bcscav' 226 CALL xios_add_child(group_handle, child, varname) 227 CALL xios_set_attr(child, name=varname, unit=unt) 228 varname=TRIM(dn)//'evapls' 229 CALL xios_add_child(group_handle, child, varname) 230 CALL xios_set_attr(child, name=varname, unit=unt) 231 varname=TRIM(dn)//'ls' 232 CALL xios_add_child(group_handle, child, varname) 233 CALL xios_set_attr(child, name=varname, unit=unt) 234 varname=TRIM(dn)//'trsp' 235 CALL xios_add_child(group_handle, child, varname) 236 CALL xios_set_attr(child, name=varname, unit=unt) 237 varname=TRIM(dn)//'sscav' 238 CALL xios_add_child(group_handle, child, varname) 239 CALL xios_set_attr(child, name=varname, unit=unt) 240 varname=TRIM(dn)//'sat' 241 CALL xios_add_child(group_handle, child, varname) 242 CALL xios_set_attr(child, name=varname, unit=unt) 243 varname=TRIM(dn)//'uscav' 244 CALL xios_add_child(group_handle, child, varname) 245 CALL xios_set_attr(child, name=varname, unit=unt) 246 END DO 247 !On ajoute les variables 2D traceurs par l interface fortran 248 CALL xios_get_handle("fields_strataer_trac_2D", group_handle) 249 ! On boucle sur les traceurs pour les ajouter au groupe puis fixer les attributs 250 DO iq = 1, nqtot 251 IF(.NOT.(tracers(iq)%isAdvected .AND. tracers(iq)%isInPhysics)) CYCLE 252 253 unt = "kg m-2" 254 varname='cum'//trim(tracers(iq)%name) 255 256 CALL xios_add_child(group_handle, child, varname) 257 CALL xios_set_attr(child, name=varname, unit=unt) 258 259 unt = "kg m-2 s-1" 260 varname='cumd'//trim(tracers(iq)%name)//'_dry' 261 CALL xios_add_child(group_handle, child, varname) 262 CALL xios_set_attr(child, name=varname, unit=unt) 263 ENDDO 264 265 266 END SUBROUTINE wxios_add_group_init 170 267 171 268 SUBROUTINE wxios_set_context() -
LMDZ6/trunk/libf/phylmd/phys_output_write_mod.F90
r4575 r4606 486 486 CHARACTER(LEN=maxlen) :: varname, dn 487 487 488 #ifdef CPP_XIOS489 TYPE(xios_fieldgroup) :: group_handle490 TYPE(xios_field) :: child491 #endif492 488 #ifdef CPP_StratAer 493 489 LOGICAL, PARAMETER :: debug_strataer=.FALSE. … … 545 541 END DO 546 542 547 #ifdef CPP_XIOS548 #ifdef CPP_StratAer549 !$OMP MASTER550 IF (.NOT.vars_defined) THEN551 !On ajoute les variables 3D traceurs par l interface fortran552 CALL xios_get_handle("fields_strataer_trac_3D", group_handle)553 ! On boucle sur les traceurs pour les ajouter au groupe puis fixer les attributs554 DO iq = 1, nqtot555 IF(.NOT.(tracers(iq)%isAdvected .AND. tracers(iq)%isInPhysics)) CYCLE556 dn = 'd'//TRIM(tracers(iq)%name)//'_'557 WRITE (lunout,*) 'XIOS var=', nqo, iq, nqtot, tracers(iq)%name558 559 unt = "kg kg-1"560 varname=trim(tracers(iq)%name)561 CALL xios_add_child(group_handle, child, varname)562 CALL xios_set_attr(child, name=varname, unit=unt)563 564 unt = "kg kg-1 s-1"565 varname=TRIM(dn)//'vdf'566 CALL xios_add_child(group_handle, child, varname)567 CALL xios_set_attr(child, name=varname, unit=unt)568 varname=TRIM(dn)//'the'569 CALL xios_add_child(group_handle, child, varname)570 CALL xios_set_attr(child, name=varname, unit=unt)571 varname=TRIM(dn)//'con'572 CALL xios_add_child(group_handle, child, varname)573 CALL xios_set_attr(child, name=varname, unit=unt)574 varname=TRIM(dn)//'lessi_impa'575 CALL xios_add_child(group_handle, child, varname)576 CALL xios_set_attr(child, name=varname, unit=unt)577 varname=TRIM(dn)//'lessi_nucl'578 CALL xios_add_child(group_handle, child, varname)579 CALL xios_set_attr(child, name=varname, unit=unt)580 varname=TRIM(dn)//'insc'581 CALL xios_add_child(group_handle, child, varname)582 CALL xios_set_attr(child, name=varname, unit=unt)583 varname=TRIM(dn)//'bcscav'584 CALL xios_add_child(group_handle, child, varname)585 CALL xios_set_attr(child, name=varname, unit=unt)586 varname=TRIM(dn)//'evapls'587 CALL xios_add_child(group_handle, child, varname)588 CALL xios_set_attr(child, name=varname, unit=unt)589 varname=TRIM(dn)//'ls'590 CALL xios_add_child(group_handle, child, varname)591 CALL xios_set_attr(child, name=varname, unit=unt)592 varname=TRIM(dn)//'trsp'593 CALL xios_add_child(group_handle, child, varname)594 CALL xios_set_attr(child, name=varname, unit=unt)595 varname=TRIM(dn)//'sscav'596 CALL xios_add_child(group_handle, child, varname)597 CALL xios_set_attr(child, name=varname, unit=unt)598 varname=TRIM(dn)//'sat'599 CALL xios_add_child(group_handle, child, varname)600 CALL xios_set_attr(child, name=varname, unit=unt)601 varname=TRIM(dn)//'uscav'602 CALL xios_add_child(group_handle, child, varname)603 CALL xios_set_attr(child, name=varname, unit=unt)604 END DO605 !On ajoute les variables 2D traceurs par l interface fortran606 CALL xios_get_handle("fields_strataer_trac_2D", group_handle)607 ! On boucle sur les traceurs pour les ajouter au groupe puis fixer les attributs608 DO iq = 1, nqtot609 IF(.NOT.(tracers(iq)%isAdvected .AND. tracers(iq)%isInPhysics)) CYCLE610 611 unt = "kg m-2"612 varname='cum'//trim(tracers(iq)%name)613 WRITE (lunout,*) 'XIOS var=', iq, nqtot, varname614 CALL xios_add_child(group_handle, child, varname)615 CALL xios_set_attr(child, name=varname, unit=unt)616 617 unt = "kg m-2 s-1"618 varname='cumd'//trim(tracers(iq)%name)//'_dry'619 CALL xios_add_child(group_handle, child, varname)620 CALL xios_set_attr(child, name=varname, unit=unt)621 ENDDO622 ENDIF623 !$OMP END MASTER624 #endif625 #endif626 543 627 544 ! ug la boucle qui suit ne sert qu'une fois, pour l'initialisation, sinon il n'y a toujours qu'un seul passage:
Note: See TracChangeset
for help on using the changeset viewer.