Changeset 3092 for trunk/LMDZ.MARS/libf/phymars/write_output_mod.F90
- Timestamp:
- Oct 18, 2023, 3:35:24 PM (12 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LMDZ.MARS/libf/phymars/write_output_mod.F90
r3055 r3092 1 1 MODULE write_output_mod 2 IMPLICIT NONE 2 3 IMPLICIT NONE 4 3 5 PRIVATE 4 5 6 MODULE PROCEDURE write_output_d0,write_output_d1,write_output_d2, &7 write_output_i0,write_output_i1,write_output_i2, &8 write_output_l0,write_output_l1,write_output_l29 10 END INTERFACE write_output 11 12 PUBLIC write_output 13 6 7 INTERFACE write_output 8 MODULE PROCEDURE write_output_d0, write_output_d1, write_output_d2, & 9 write_output_i0, write_output_i1, write_output_i2, & 10 write_output_l0, write_output_l1, write_output_l2 11 END INTERFACE write_output 12 13 PUBLIC write_output 14 15 !---------------------------------------------------------------------- 14 16 CONTAINS 17 !---------------------------------------------------------------------- 15 18 16 19 SUBROUTINE write_output_d0(field_name,title,units,field) … … 28 31 CHARACTER(LEN=*),INTENT(IN) :: units 29 32 REAL,INTENT(IN) :: field 30 33 31 34 call writediagfi(ngrid,field_name,title,units,0,field) 32 #ifdef CPP_XIOS 35 #ifdef CPP_XIOS 33 36 if (xios_is_active_field(field_name)) then 34 37 ! only send the field to xios if the user asked for it … … 36 39 endif 37 40 #endif 38 41 39 42 END SUBROUTINE write_output_d0 40 43 44 !---------------------------------------------------------------------- 45 41 46 SUBROUTINE write_output_d1(field_name,title,units,field) 42 47 ! For a surface field … … 53 58 CHARACTER(LEN=*),INTENT(IN) :: units 54 59 REAL,INTENT(IN) :: field(:) 55 60 56 61 call writediagfi(ngrid,field_name,title,units,2,field) 57 #ifdef CPP_XIOS 62 #ifdef CPP_XIOS 58 63 if (xios_is_active_field(field_name)) then 59 64 ! only send the field to xios if the user asked for it … … 61 66 endif 62 67 #endif 63 68 64 69 END SUBROUTINE write_output_d1 70 71 !---------------------------------------------------------------------- 65 72 66 73 SUBROUTINE write_output_d2(field_name,title,units,field) … … 83 90 if(size(field(:,:),2).eq.nsoilmx) then 84 91 call writediagsoil(ngrid,field_name,title,units,3,field) 85 else 92 else 86 93 call writediagfi(ngrid,field_name,title,units,3,field(:,:)) 87 94 endif 88 #ifdef CPP_XIOS 95 #ifdef CPP_XIOS 89 96 if (xios_is_active_field(field_name)) then 90 97 ! only send the field to xios if the user asked for it … … 92 99 endif 93 100 #endif 94 101 95 102 END SUBROUTINE write_output_d2 96 103 104 !---------------------------------------------------------------------- 105 97 106 SUBROUTINE write_output_i0(field_name,title,units,field) 98 107 ! For a surface field … … 109 118 CHARACTER(LEN=*),INTENT(IN) :: units 110 119 INTEGER,INTENT(IN) :: field 111 120 112 121 call writediagfi(ngrid,field_name,title,units,0,real(field)) 113 #ifdef CPP_XIOS 122 #ifdef CPP_XIOS 114 123 if (xios_is_active_field(field_name)) then 115 124 ! only send the field to xios if the user asked for it … … 117 126 endif 118 127 #endif 119 128 120 129 END SUBROUTINE write_output_i0 121 130 131 !---------------------------------------------------------------------- 132 122 133 SUBROUTINE write_output_i1(field_name,title,units,field) 123 134 ! For a surface field … … 134 145 CHARACTER(LEN=*),INTENT(IN) :: units 135 146 INTEGER,INTENT(IN) :: field(:) 136 147 137 148 call writediagfi(ngrid,field_name,title,units,2,real(field)) 138 #ifdef CPP_XIOS 149 #ifdef CPP_XIOS 139 150 if (xios_is_active_field(field_name)) then 140 151 ! only send the field to xios if the user asked for it … … 142 153 endif 143 154 #endif 144 155 145 156 END SUBROUTINE write_output_i1 157 158 !---------------------------------------------------------------------- 146 159 147 160 SUBROUTINE write_output_i2(field_name,title,units,field) … … 164 177 if(size(field(:,:),2).eq.nsoilmx) then 165 178 call writediagsoil(ngrid,field_name,title,units,3,real(field)) 166 else 179 else 167 180 call writediagfi(ngrid,field_name,title,units,3,real(field(:,:))) 168 181 endif 169 #ifdef CPP_XIOS 182 #ifdef CPP_XIOS 170 183 if (xios_is_active_field(field_name)) then 171 184 ! only send the field to xios if the user asked for it … … 173 186 endif 174 187 #endif 175 188 176 189 END SUBROUTINE write_output_i2 190 191 !---------------------------------------------------------------------- 177 192 178 193 SUBROUTINE write_output_l0(field_name,title,units,field) … … 195 210 field_real=0 196 211 if(field) field_real=1 197 212 198 213 call writediagfi(ngrid,field_name,title,units,0,field_real) 199 #ifdef CPP_XIOS 214 #ifdef CPP_XIOS 200 215 if (xios_is_active_field(field_name)) then 201 216 ! only send the field to xios if the user asked for it … … 203 218 endif 204 219 #endif 205 220 206 221 END SUBROUTINE write_output_l0 222 223 !---------------------------------------------------------------------- 207 224 208 225 SUBROUTINE write_output_l1(field_name,title,units,field) … … 228 245 if(field(i)) field_real(i)=1. 229 246 ENDDO 230 247 231 248 call writediagfi(ngrid,field_name,title,units,2,field_real(:)) 232 #ifdef CPP_XIOS 249 #ifdef CPP_XIOS 233 250 if (xios_is_active_field(field_name)) then 234 251 ! only send the field to xios if the user asked for it … … 236 253 endif 237 254 #endif 238 255 239 256 END SUBROUTINE write_output_l1 257 258 !---------------------------------------------------------------------- 240 259 241 260 SUBROUTINE write_output_l2(field_name,title,units,field) … … 270 289 if(size(field(:,:),2).eq.nsoilmx) then 271 290 call writediagsoil(ngrid,field_name,title,units,3,field_real) 272 else 291 else 273 292 call writediagfi(ngrid,field_name,title,units,3,field_real(:,:)) 274 293 endif 275 294 276 #ifdef CPP_XIOS 295 #ifdef CPP_XIOS 277 296 if (xios_is_active_field(field_name)) then 278 297 ! only send the field to xios if the user asked for it … … 280 299 endif 281 300 #endif 282 301 283 302 deallocate(field_real) 284 303
Note: See TracChangeset
for help on using the changeset viewer.