- Timestamp:
- 2019-11-26T18:17:21+01:00 (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
NEMO/branches/2019/dev_r11879_ENHANCE-05_SimonM-Harmonic_Analysis/src/OCE/DIA/diamlr.F90
r11961 r11971 60 60 TYPE(xios_fieldgroup) :: slxhdl_fldgrp 61 61 TYPE(xios_filegroup) :: slxhdl_filgrp 62 TYPE(xios_field), ALLOCATABLE, DIMENSION(:) :: slxhdl_regs, slxhdl_flds62 TYPE(xios_field), ALLOCATABLE, DIMENSION(:) :: slxhdl_regs, slxhdl_flds 63 63 TYPE(xios_field) :: slxhdl_fld 64 64 TYPE(xios_file) :: slxhdl_fil 65 LOGICAL :: llxatt_enabled 66 CHARACTER(LEN=256) :: clxatt_expr 65 LOGICAL :: llxatt_enabled, llxatt_comment 66 CHARACTER(LEN=256) :: clxatt_expr, clxatt_comment 67 67 CHARACTER(LEN=32) :: clxatt_name1, clxatt_name2 68 68 CHARACTER(LEN=32) :: clxatt_gridref, clxatt_fieldref … … 124 124 CALL xios_add_child ( slxhdl_filgrp, slxhdl_fil, "diamlr_file_"//cl6a ) 125 125 CALL xios_set_attr ( slxhdl_fil, name_suffix="_diamlr_"//cl6a, & 126 & description="Intermedia ryoutput for multiple-linear-regression analysis - "//cl6a )126 & description="Intermediate output for multiple-linear-regression analysis - "//cl6a ) 127 127 CALL iom_update_file_name( "diamlr_file_"//cl6a ) 128 128 END DO … … 193 193 END DO 194 194 195 ! Set name attribute (and overwrite possible pre-configured name) 196 ! with field id to enable id string retrieval from stored handle 197 ! below; also re-set expression with possible substitutions 198 CALL xios_set_attr ( slxhdl_regs(ireg+1), name="diamlr_r"//cl3i, expr=TRIM( clxatt_expr ) ) 195 ! Set standard value for comment attribute, including possible 196 ! existing comment added in parantheses 197 CALL xios_is_defined_attr( slxhdl_regs(ireg+1), comment=llxatt_comment ) 198 IF ( llxatt_comment ) THEN 199 CALL xios_get_attr( slxhdl_regs(ireg+1), comment=clxatt_comment ) 200 clxatt_comment = "Regressor "//cl3i//" ("//TRIM( clxatt_comment )//") " 201 ELSE 202 clxatt_comment = "Regressor "//cl3i 203 END IF 204 205 ! Set name attribute (and overwrite possible pre-configured 206 ! name) with field id to enable id string retrieval from 207 ! stored handle below, re-set expression with possible 208 ! substitutions, and set or re-set comment attribute 209 CALL xios_set_attr ( slxhdl_regs(ireg+1), name="diamlr_r"//cl3i, expr=TRIM( clxatt_expr ), & 210 & comment=TRIM( clxatt_comment ) ) 199 211 200 212 ireg = ireg + 1 ! Accept regressor in list of active regressors … … 241 253 ! 3-dimensional versions are simply obtained via grid 242 254 ! transformations from the 2-dimensional version. 243 CALL xios_get_attr ( slxhdl_regs( jm ), name=clxatt_name1, expr=clxatt_expr, enabled=llxatt_enabled ) 255 CALL xios_get_attr ( slxhdl_regs( jm ), name=clxatt_name1, expr=clxatt_expr, & 256 & enabled=llxatt_enabled, comment=clxatt_comment ) 244 257 CALL xios_add_child ( slxhdl_fldgrp, slxhdl_fld, TRIM( clxatt_name1 )//"_2D" ) 245 258 CALL xios_set_attr ( slxhdl_fld, expr=TRIM( clxatt_expr ), grid_ref="diamlr_grid_2D", & … … 251 264 & field_ref=TRIM( clxatt_name1 )//"_2D", enabled=llxatt_enabled) 252 265 253 ! ii) set up definitions for the output of scalar products with 254 ! itself and with other active regressors 266 ! ii) set up output of active regressors, including metadata 267 CALL xios_get_handle( "diamlr_file_scalar", slxhdl_fil ) 268 ! Add regressor to output file 269 CALL xios_add_child ( slxhdl_fil, slxhdl_fld, TRIM( clxatt_name1 ) ) 270 CALL xios_set_attr ( slxhdl_fld, standard_name=TRIM( clxatt_comment ), long_name=TRIM( clxatt_expr ), & 271 & operation="average" ) 272 273 ! iii) set up the output of scalar products with itself and with 274 ! other active regressors 255 275 CALL xios_get_attr ( slxhdl_regs(jm), name=clxatt_name1 ) 256 CALL xios_get_handle( "diamlr_file_scalar", slxhdl_fil)257 276 DO jn = 1, jm 258 277 ! Field for product between regressors 259 CALL xios_get_attr ( slxhdl_regs(jn), name=clxatt_name2 , enabled=llxatt_enabled)278 CALL xios_get_attr ( slxhdl_regs(jn), name=clxatt_name2 ) 260 279 CALL xios_add_child ( slxhdl_fldgrp, slxhdl_fld, TRIM( clxatt_name1 )//"."//TRIM( clxatt_name2 ) ) 261 280 ! Set appropriate name attribute to avoid the possibility of 262 281 ! using an inappropriate inherited name attribute as the variable 263 282 ! name in the output file 264 CALL xios_set_attr ( slxhdl_fld, name=TRIM( clxatt_name1 )//"."//TRIM( clxatt_name2 ), & 265 & grid_ref="diamlr_grid_scalar", expr="this * "//TRIM( clxatt_name2 ), & 266 & field_ref=TRIM( clxatt_name1 ), enabled=llxatt_enabled, operation="accumulate") 283 CALL xios_set_attr ( slxhdl_fld, & 284 & name=TRIM( clxatt_name1 )//"."//TRIM( clxatt_name2 ), & 285 & grid_ref="diamlr_grid_scalar", & 286 & expr="this * "//TRIM( clxatt_name2 ), & 287 & field_ref=TRIM( clxatt_name1 ), & 288 & enabled=llxatt_enabled, & 289 & long_name="Scalar product of regressor "//TRIM( clxatt_name1 )// & 290 & " and regressor "//TRIM( clxatt_name2 ), & 291 & standard_name=TRIM( clxatt_name1 )//"."//TRIM( clxatt_name2 ), & 292 & operation="accumulate") 267 293 ! Add regressor-product field to output file 268 294 CALL xios_add_child ( slxhdl_fil, slxhdl_fld, TRIM( clxatt_name1 )//"."//TRIM( clxatt_name2 ) ) … … 282 308 ! Set appropriate name attribute to avoid the possibility of 283 309 ! using an inappropriate inherited name attribute as the variable 284 ! name in the output file 285 CALL xios_set_attr ( slxhdl_fld, name=TRIM( clxatt_name2 )//"."//TRIM( clxatt_name1 ), & 286 & expr="this * "//TRIM( clxatt_fieldref ), grid_ref="diamlr_grid_"//clgd, & 287 & field_ref=TRIM( clxatt_name1 )//"_"//clgd, enabled=llxatt_enabled, operation="accumulate" ) 310 ! name in the output file; use metadata (standard_name and 311 ! long_name) to refer to the id of the analysed field 312 CALL xios_set_attr ( slxhdl_fld, & 313 & name=TRIM( clxatt_name2 )//"."//TRIM( clxatt_name1 ), & 314 & expr="this * "//TRIM( clxatt_fieldref ), & 315 & grid_ref="diamlr_grid_"//clgd, & 316 & field_ref=TRIM( clxatt_name1 )//"_"//clgd, & 317 & enabled=llxatt_enabled, & 318 & long_name="Scalar product of "//TRIM( clxatt_fieldref )// & 319 & " and regressor "//TRIM( clxatt_name1 ), & 320 & standard_name=TRIM( clxatt_fieldref )//"."//TRIM( clxatt_name1 ), & 321 & operation="accumulate" ) 288 322 CALL xios_get_handle( "diamlr_file_grid_"//clgt, slxhdl_fil ) 289 323 CALL xios_add_child ( slxhdl_fil, slxhdl_fld, TRIM( clxatt_name2 )//"."//TRIM( clxatt_name1 ) )
Note: See TracChangeset
for help on using the changeset viewer.