Changeset 3506 for trunk/LMDZ.PLUTO/libf/phypluto/xios_output_mod.F90
- Timestamp:
- Nov 8, 2024, 10:57:27 AM (2 weeks ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LMDZ.PLUTO/libf/phypluto/xios_output_mod.F90
r3501 r3506 11 11 12 12 INTERFACE send_xios_field 13 MODULE PROCEDURE histwrite0d_xios,histwrite 2d_xios,histwrite3d_xios!,histwrite1d_xios13 MODULE PROCEDURE histwrite0d_xios,histwrite1d_xios,histwrite2d_xios,histwrite3d_xios 14 14 END INTERFACE 15 15 … … 17 17 CONTAINS 18 18 19 SUBROUTINE initialize_xios_output(day,timeofday,dtphys,daysec,& 20 yearday,presnivs,pseudoalt,wnoi,wnov) 21 ! USE mod_phys_lmdz_para, only: gather, bcast, & 22 ! jj_nb, jj_begin, jj_end, ii_begin, ii_end, & 23 ! mpi_size, mpi_rank, klon_mpi, & 24 ! is_sequential, is_south_pole_dyn 19 SUBROUTINE initialize_xios_output(day,timeofday,dtphys,daysec,yearday, & 20 presnivs,pseudoalt,mlayer,wnoi,wnov) 25 21 USE mod_phys_lmdz_para, ONLY: jj_nb, jj_begin, jj_end, ii_begin, ii_end, & 26 22 mpi_size, mpi_rank, klon_mpi, & … … 44 40 REAL,INTENT(IN) :: presnivs(:) ! vertical grid approximate pressure (Pa) 45 41 REAL,INTENT(IN) :: pseudoalt(:) ! vertical grid approximate altitude (km) 42 REAL,INTENT(IN) :: mlayer(:) ! soil layer depth at intermediate level (m) 46 43 REAL,INTENT(IN) :: wnoi(:) ! Array of wavenumbers at the spectral interval centers for the infrared. 47 44 real,intent(in) :: wnov (:) !Array of wavenumbers at the spectral interval centers for the visible. 45 48 46 49 47 INTEGER :: data_ibegin, data_iend … … 62 60 CALL xios_set_axis_attr("altitude", n_glo=size(pseudoalt), value=pseudoalt,& 63 61 unit="km",positive="up") 62 CALL xios_set_axis_attr("interlayer", n_glo=size(pseudoalt)+1,& 63 unit="km",positive="up") 64 IF (prt_level>=10) WRITE(lunout,*) "initialize_xios_output: call xios_set_axis_attr for soil" 65 CALL xios_set_axis_attr("soil_layers", n_glo=size(mlayer), value=mlayer,& 66 unit="m",positive="down") 64 67 if (prt_level >=10) write(lunout,*) "initialize_xios_output: call xios_set_axis_attr for IR_Wavenumber" 65 68 write(lunout,*) "writing IR_Wavenumber now in initialize_xios_output" … … 139 142 ! Now define the start time of this simulation 140 143 ! NB: we substract dtphys because we want to set the origin of the time axis 141 start_date=time_origin +xios_duration(0,0,day,0,0,timeofday*daysec-dtphys)144 start_date=time_origin 142 145 call xios_set_start_date(start_date=start_date) 143 146 if (prt_level>=10) then … … 148 151 if (prt_level>=10) write(*,*) "initialize_xios_output: call wxios_closedef" 149 152 CALL wxios_closedef() 153 if (prt_level>=10) write(*,*) "initialize_xios_output: after call wxios_closedef" 150 154 151 155 !$OMP END MASTER … … 211 215 212 216 END SUBROUTINE histwrite0d_xios 217 218 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 219 220 SUBROUTINE histwrite1d_xios(field_name,field,dimens) 221 USE xios, ONLY: xios_send_field 222 USE print_control_mod, ONLY: prt_level, lunout 223 IMPLICIT NONE 224 225 CHARACTER(LEN=*), INTENT(IN) :: field_name 226 REAL, DIMENSION(:), INTENT(IN) :: field 227 INTEGER, INTENT(IN) :: dimens 228 IF (prt_level >= 10) WRITE(lunout,*)'Begin histrwrite1d_xios ',trim(field_name) 229 !$OMP MASTER 230 CALL xios_send_field(field_name,field) 231 !$OMP END MASTER 232 233 IF (prt_level >= 10) WRITE(lunout,*)'End histrwrite1d_xios ',trim(field_name) 234 235 END SUBROUTINE histwrite1d_xios 213 236 214 237 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! … … 221 244 USE print_control_mod, ONLY: prt_level, lunout 222 245 USE mod_grid_phy_lmdz, ONLY: nbp_lon 223 USE radinc_h ,only: L_NSPECTI,L_NSPECTV224 246 IMPLICIT NONE 225 247 … … 230 252 REAL :: Field2d(nbp_lon,jj_nb) 231 253 254 CHARACTER(len=128) :: msg 255 232 256 IF (prt_level >= 10) WRITE(lunout,*)'Begin histrwrite2d_xios ',trim(field_name) 233 if ((size(field) .eq. L_NSPECTI) .or. (size(field) .eq. L_NSPECTV)) then 234 !$OMP MASTER 235 ! only for spectral stuff: IR_Bandwidth and VI_Bandwidth 236 call xios_send_field(field_name,field) 237 !$OMP END MASTER 238 return 239 endif 240 IF (SIZE(field)/=klon) CALL abort_physic('iophy::histwrite2d_xios','Field first DIMENSION not equal to klon',1) 241 257 IF (SIZE(field)/=klon) THEN 258 WRITE(msg,*) "Pb with field "//trim(field_name)//& 259 " : Field first DIMENSION not equal to klon" 260 CALL abort_physic('iophy::histwrite2d_xios',trim(msg),1) 261 ENDIF 242 262 CALL Gather_omp(field,buffer_omp) 243 263 !$OMP MASTER … … 269 289 INTEGER :: ip, n, nlev 270 290 291 CHARACTER(len=128) :: msg 292 271 293 IF (prt_level >= 10) write(lunout,*)'Begin histrwrite3d_xios ',trim(field_name) 272 294 273 !Et on.... écrit 274 IF (SIZE(field,1)/=klon) CALL abort_physic('iophy::histwrite3d','Field first DIMENSION not equal to klon',1) 295 !And we write... 296 IF (SIZE(field,1)/=klon) THEN 297 WRITE(msg,*) "Pb with field "//trim(field_name)//& 298 " : Field first DIMENSION not equal to klon" 299 CALL abort_physic('iophy::histwrite3d',trim(msg),1) 300 ENDIF 301 275 302 nlev=SIZE(field,2) 276 303 … … 286 313 END SUBROUTINE histwrite3d_xios 287 314 315 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 316 317 FUNCTION xios_is_active_field(field_id) 318 USE xios, only: xios_field_is_active 319 USE mod_phys_lmdz_omp_transfert, only: bcast_omp 320 IMPLICIT NONE 321 LOGICAL :: xios_is_active_field 322 CHARACTER(LEN=*) :: field_id 323 324 ! check with XIOS if "field_id" is requested by the user 325 ! to be in the output file(s) 326 327 !$OMP BARRIER 328 !$OMP MASTER 329 xios_is_active_field = xios_field_is_active(field_id) 330 !$OMP END MASTER 331 CALL bcast_omp(xios_is_active_field) 332 END FUNCTION xios_is_active_field 333 288 334 #endif 289 335
Note: See TracChangeset
for help on using the changeset viewer.