Changeset 4157 for trunk/LMDZ.COMMON/libf/evolution/xios_data.F90
- Timestamp:
- Mar 26, 2026, 4:29:10 PM (12 days ago)
- File:
-
- 1 edited
-
trunk/LMDZ.COMMON/libf/evolution/xios_data.F90 (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LMDZ.COMMON/libf/evolution/xios_data.F90
r4147 r4157 72 72 real(dp), dimension(:,:,:), allocatable :: var_read_3d 73 73 real(dp), dimension(:,:,:,:), allocatable :: var_read_4d 74 character( :), allocatable :: num ! To read slopevariables74 character(8) :: num ! Slope suffix to read variables 75 75 76 76 ! CODE … … 81 81 minPCM_h2ofrost(:,:,:) = 0._dp 82 82 minPCM_co2frost(:,:,:) = 0._dp 83 if (nslope == 1) then ! No slope 84 allocate(character(0) :: num) 85 else ! Using slopes 86 allocate(character(8) :: num) 87 end if 83 num = '' 88 84 89 85 !~~~~~~~~~~~~~~~~~~~~~~~~ Year 1 - Yearly data ~~~~~~~~~~~~~~~~~~~~~~~~~ … … 98 94 allocate(var_read_2d(nlon,nlat),var_read_3d(nlon,nlat,nsoil_PCM)) 99 95 do islope = 1,nslope 100 if (nslope /= 1) then101 num = ' '102 write(num,'(i2.2)') islope103 num = '_slope'//num96 if (nslope == 1) then 97 num = '' 98 else 99 write(num,'("_slope",i2.2)') islope 104 100 end if 105 call get_var_nc('co2ice'// num,var_read_2d) ; call lonlat2vect(var_read_2d,minPCM_co2frost(:,islope,1))106 call get_var_nc('h2o_ice_s'// num,var_read_2d) ; call lonlat2vect(var_read_2d,minPCM_h2ofrost(:,islope,1))107 call get_var_nc('watercap'// num,var_read_2d) ; call lonlat2vect(var_read_2d,minPCM_h2operice(:,islope,1))108 call get_var_nc('perennial_co2ice'// num,var_read_2d); call lonlat2vect(var_read_2d,minPCM_co2perice(:,islope,1))109 call get_var_nc('tsurf'// num,var_read_2d) ; call lonlat2vect(var_read_2d,tsurf_avg_yr1(:,islope))101 call get_var_nc('co2ice'//trim(num),var_read_2d) ; call lonlat2vect(var_read_2d,minPCM_co2frost(:,islope,1)) 102 call get_var_nc('h2o_ice_s'//trim(num),var_read_2d) ; call lonlat2vect(var_read_2d,minPCM_h2ofrost(:,islope,1)) 103 call get_var_nc('watercap'//trim(num),var_read_2d) ; call lonlat2vect(var_read_2d,minPCM_h2operice(:,islope,1)) 104 call get_var_nc('perennial_co2ice'//trim(num),var_read_2d); call lonlat2vect(var_read_2d,minPCM_co2perice(:,islope,1)) 105 call get_var_nc('tsurf'//trim(num),var_read_2d) ; call lonlat2vect(var_read_2d,tsurf_avg_yr1(:,islope)) 110 106 end do 111 107 … … 123 119 call get_var_nc('ps',var_read_2d); call lonlat2vect(var_read_2d,ps_avg) 124 120 do islope = 1,nslope 125 if (nslope /= 1) then126 num =''127 write(num,'(i2.2)') islope128 num = '_slope'//num121 if (nslope == 1) then 122 num = '' 123 else 124 write(num,'("_slope",i2.2)') islope 129 125 end if 130 call get_var_nc('tsurf'// num,var_read_2d) ; call lonlat2vect(var_read_2d,tsurf_avg(:,islope))131 call get_var_nc('co2ice'// num,var_read_2d) ; call lonlat2vect(var_read_2d,minPCM_co2frost(:,islope,2))132 call get_var_nc('h2o_ice_s'// num,var_read_2d) ; call lonlat2vect(var_read_2d,minPCM_h2ofrost(:,islope,2))133 call get_var_nc('watercap'// num,var_read_2d) ; call lonlat2vect(var_read_2d,minPCM_h2operice(:,islope,2))134 call get_var_nc('perennial_co2ice'// num,var_read_2d); call lonlat2vect(var_read_2d,minPCM_co2perice(:,islope,2))126 call get_var_nc('tsurf'//trim(num),var_read_2d) ; call lonlat2vect(var_read_2d,tsurf_avg(:,islope)) 127 call get_var_nc('co2ice'//trim(num),var_read_2d) ; call lonlat2vect(var_read_2d,minPCM_co2frost(:,islope,2)) 128 call get_var_nc('h2o_ice_s'//trim(num),var_read_2d) ; call lonlat2vect(var_read_2d,minPCM_h2ofrost(:,islope,2)) 129 call get_var_nc('watercap'//trim(num),var_read_2d) ; call lonlat2vect(var_read_2d,minPCM_h2operice(:,islope,2)) 130 call get_var_nc('perennial_co2ice'//trim(num),var_read_2d); call lonlat2vect(var_read_2d,minPCM_co2perice(:,islope,2)) 135 131 if (do_soil) then 136 call get_var_nc('soiltemp'// num,var_read_3d)132 call get_var_nc('soiltemp'//trim(num),var_read_3d) 137 133 do isoil = 1,nsoil_PCM 138 134 call lonlat2vect(var_read_3d(:,:,isoil),tsoil_avg(:,isoil,islope)) … … 141 137 tsoil_avg(:,isoil,islope) = tsoil_avg(:,nsoil_PCM,islope) ! Explicit initialization because dimension with size nsoil > nsoil_PCM 142 138 end do 143 call get_var_nc('waterdensity_surface'// num,var_read_2d); call lonlat2vect(var_read_2d,h2o_surfdensity_avg(:,islope))139 call get_var_nc('waterdensity_surface'//trim(num),var_read_2d); call lonlat2vect(var_read_2d,h2o_surfdensity_avg(:,islope)) 144 140 end if 145 141 end do … … 173 169 h2o_soildensity_avg(:,:,:) = 0._dp 174 170 do islope = 1,nslope 175 if (nslope /= 1) then176 num =''177 write(num,'(i2.2)') islope178 num = '_slope'//num171 if (nslope == 1) then 172 num = '' 173 else 174 write(num,'("_slope",i2.2)') islope 179 175 end if 180 call get_var_nc('soiltemp'// num,var_read_4d)176 call get_var_nc('soiltemp'//trim(num),var_read_4d) 181 177 do iday = 1,nday 182 178 do isoil = 1,nsoil_PCM … … 187 183 end do 188 184 end do 189 call get_var_nc('waterdensity_soil'// num,var_read_4d)185 call get_var_nc('waterdensity_soil'//trim(num),var_read_4d) 190 186 do iday = 1,nday 191 187 do isoil = 1,nsoil_PCM … … 200 196 h2o_soildensity_avg(:,:,:) = h2o_soildensity_avg(:,:,:)/real(nday,dp) 201 197 end if 202 deallocate(var_read_1d,var_read_3d,var_read_4d ,num)198 deallocate(var_read_1d,var_read_3d,var_read_4d) 203 199 204 200 ! Close the NetCDF file of XIOS outputs
Note: See TracChangeset
for help on using the changeset viewer.
