Changeset 7576 for branches/ORCHIDEE_2_2
- Timestamp:
- 2022-04-14T10:01:23+02:00 (3 years ago)
- Location:
- branches/ORCHIDEE_2_2/ORCHIDEE
- Files:
-
- 1 added
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/ORCHIDEE_2_2/ORCHIDEE/src_parallel/ioipsl_para.f90
r5811 r7576 46 46 USE mod_orchidee_para_var 47 47 USE mod_orchidee_transfert_para 48 USE constantes_var, ONLY: val_exp 48 49 !- 49 50 IMPLICIT NONE … … 86 87 MODULE PROCEDURE & 87 88 restput_p_r3d, restput_p_r2d, restput_p_r1d, & 88 restput_p_opp_r2d, restput_p_opp_r1d 89 restput_p_opp_r2d, restput_p_opp_r1d, & 90 restput_p_nogrid_r_scal, restput_p_nogrid_i_scal 89 91 END INTERFACE 90 92 !- … … 98 100 !! \n 99 101 !_ ================================================================================================================================ 100 INTERFACE restget_p102 INTERFACE restget_p 101 103 MODULE PROCEDURE & 102 104 restget_p_r3d, restget_p_r2d, restget_p_r1d, & 103 restget_p_opp_r2d, restget_p_opp_r1d 105 restget_p_opp_r2d, restget_p_opp_r1d, & 106 restget_p_nogrid_r_scal, restget_p_nogrid_i_scal 104 107 END INTERFACE 105 108 … … 971 974 END SUBROUTINE histwrite_r3d_p 972 975 976 !! ============================================================================================================================= 977 !! SUBROUTINE: restput_p_nogrid_r_scal 978 !! 979 !>\BRIEF save real scalar (non-grid) data into the restart file 980 !! 981 !! DESCRIPTION: Need to be call by all process 982 !! 983 !! \n 984 !_ ============================================================================================================================== 985 SUBROUTINE restput_p_nogrid_r_scal (fid,vname_q,itau,var) 986 IMPLICIT NONE 987 !- 988 INTEGER :: fid 989 CHARACTER(LEN=*) :: vname_q 990 INTEGER :: itau 991 REAL :: var 992 !----------------------------- 993 REAL :: xtmp(1) 994 995 IF (is_root_prc) THEN 996 xtmp(1) = var 997 CALL restput (fid, vname_q, 1, 1, 1, itau, xtmp) 998 ENDIF 999 1000 END SUBROUTINE restput_p_nogrid_r_scal 1001 1002 !! ============================================================================================================================= 1003 !! SUBROUTINE: restput_p_nogrid_i_scal 1004 !! 1005 !>\BRIEF save integer scalar (non-grid) data into the restart file 1006 !! 1007 !! DESCRIPTION: Need to be call by all process 1008 !! 1009 !! \n 1010 !_ ============================================================================================================================== 1011 SUBROUTINE restput_p_nogrid_i_scal (fid,vname_q,itau,var) 1012 IMPLICIT NONE 1013 !- 1014 INTEGER :: fid 1015 CHARACTER(LEN=*) :: vname_q 1016 INTEGER :: itau 1017 INTEGER :: var 1018 !----------------------------- 1019 REAL :: xtmp(1) 1020 REAL :: realvar 1021 1022 IF (is_root_prc) THEN 1023 realvar = REAL(var,r_std) 1024 xtmp(1) = realvar 1025 CALL restput (fid, vname_q, 1, 1, 1, itau, xtmp) 1026 ENDIF 1027 1028 END SUBROUTINE restput_p_nogrid_i_scal 1029 1030 !! ============================================================================================================================= 1031 !! SUBROUTINE: restget_p_nogrid_r_scal 1032 !! 1033 !>\BRIEF Transform the data (real scalar) from the restart file onto the model grid 1034 !! 1035 !! DESCRIPTION: 1036 !! \n 1037 !_ ============================================================================================================================== 1038 SUBROUTINE restget_p_nogrid_r_scal & 1039 (fid,vname_q,itau,def_beha,def_val,var) 1040 ! 1041 IMPLICIT NONE 1042 !- 1043 INTEGER, INTENT(in) :: fid 1044 CHARACTER(LEN=*), INTENT(in) :: vname_q 1045 INTEGER, INTENT(in) :: itau 1046 LOGICAL, INTENT(in) :: def_beha 1047 REAL, INTENT(in) :: def_val 1048 REAL, INTENT(out) :: var 1049 !------------------------- 1050 REAL, DIMENSION(1) :: tmp 1051 1052 tmp(1) = var 1053 IF (is_root_prc) THEN 1054 var = val_exp 1055 CALL restget (fid, vname_q, 1 ,1 , 1, itau, def_beha, tmp) 1056 var = tmp(1) 1057 IF(var == val_exp) var = def_val 1058 ENDIF 1059 CALL bcast(var) 1060 1061 END SUBROUTINE restget_p_nogrid_r_scal 1062 1063 !! ============================================================================================================================= 1064 !! SUBROUTINE: restget_p_nogrid_i_scal 1065 !! 1066 !>\BRIEF Transform the data (integer scalar) from the restart file onto the model grid 1067 !! 1068 !! DESCRIPTION: 1069 !! \n 1070 !_ ============================================================================================================================== 1071 SUBROUTINE restget_p_nogrid_i_scal & 1072 (fid,vname_q,itau,def_beha,def_val,varint) 1073 ! 1074 IMPLICIT NONE 1075 !- 1076 INTEGER, INTENT(in) :: fid 1077 CHARACTER(LEN=*), INTENT(in) :: vname_q 1078 INTEGER, INTENT(in) :: itau 1079 LOGICAL, INTENT(in) :: def_beha 1080 REAL, INTENT(in) :: def_val 1081 INTEGER, INTENT(out) :: varint 1082 !------------------------- 1083 REAL :: tmp 1084 1085 CALL restget_p_nogrid_r_scal(fid, vname_q, itau, def_beha, def_val, tmp) 1086 varint = INT(tmp) 1087 END SUBROUTINE restget_p_nogrid_i_scal 1088 973 1089 974 1090 END MODULE ioipsl_para -
branches/ORCHIDEE_2_2/ORCHIDEE/src_parallel/xios_orchidee.f90
r7510 r7576 62 62 xios_orchidee_close_definition, & 63 63 xios_orchidee_send_field, xios_orchidee_recv_field, & 64 xios_orchidee_set_file_attr, xios_orchidee_set_field_attr, xios_orchidee_set_fieldgroup_attr, xios_orchidee_setvar 64 xios_orchidee_set_file_attr, xios_orchidee_set_field_attr, xios_orchidee_set_fieldgroup_attr, xios_orchidee_setvar, xios_orchidee_addaxis 65 65 66 66 … … 302 302 303 303 ELSE IF (grid_type==regular_xy ) THEN 304 ! Global domain 304 305 ! Global domain 305 306 CALL xios_set_domain_attr("domain_landpoints", ni_glo=iim_g, nj_glo=jjm_g) 306 ! Local MPI domain307 ! Local MPI domain 307 308 CALL xios_set_domain_attr("domain_landpoints",type="curvilinear", ibegin=0, ni=iim_g, jbegin=jj_begin-1, nj=jj_nb) 308 309 … … 387 388 CALL xios_set_field_attr("riversret",enabled=.FALSE.) 388 389 CALL xios_set_field_attr("hydrographs",enabled=.FALSE.) 390 CALL xios_set_field_attr("htuhgmon",enabled=.FALSE.) 389 391 CALL xios_set_field_attr("fastr",enabled=.FALSE.) 390 392 CALL xios_set_field_attr("slowr",enabled=.FALSE.) … … 414 416 END IF 415 417 416 417 418 IF (.NOT. ok_freeze_cwrr) THEN 418 419 CALL xios_set_field_attr("profil_froz_hydro",enabled=.FALSE.) … … 432 433 CALL xios_set_field_attr("floodmap",enabled=.FALSE.) 433 434 CALL xios_set_field_attr("floodh",enabled=.FALSE.) 434 CALL xios_set_field_attr("floodout",enabled=.FALSE.) 435 CALL xios_set_field_attr("floodout",enabled=.FALSE.) 436 CALL xios_set_field_attr("flood_frac",enabled=.FALSE.) 435 437 END IF 436 438 … … 606 608 !! 6. Close context 607 609 ! 608 CALL xios_close_context_definition() 610 CALL xios_close_context_definition() 611 WRITE(numout,*) 'Done xios_orchidee_close_context' 609 612 610 613 ! … … 667 670 END SUBROUTINE xios_orchidee_change_context 668 671 672 !! 673 !! ============================================================================================================================== 674 !! SUBROUTINE : xios_orchidee_addaxis 675 !! 676 !>\BRIEF Use this subroutine to add axes, needed for nbasmon and nbasmax in routing_highres.f90 677 !! 678 !! 679 !! DESCRIPTION :\n 680 !! 681 !! \n 682 !_ ================================================================================================================================ 683 SUBROUTINE xios_orchidee_addaxis(axname, axlen, axval) 684 ! 685 ! INPUT variables 686 CHARACTER(LEN=*), INTENT(IN) :: axname 687 INTEGER(i_std), INTENT(IN) :: axlen 688 REAL(r_std), DIMENSION(axlen), INTENT(IN) :: axval 689 ! 690 IF (xios_orchidee_ok .AND. is_omp_root) THEN 691 CALL xios_set_axis_attr(axname, n_glo=axlen, VALUE=axval) 692 ENDIF 693 ! 694 END SUBROUTINE xios_orchidee_addaxis 695 !! 696 697 669 698 !! ============================================================================================================================== 670 699 !! SUBROUTINE : xios_orchidee_update_calendar -
branches/ORCHIDEE_2_2/ORCHIDEE/src_sechiba/routing.f90
r7500 r7576 58 58 IMPLICIT NONE 59 59 PRIVATE 60 PUBLIC :: routing_main, routing_initialize, routing_finalize, routing_clear, routing_names 60 PUBLIC :: routing_main, routing_initialize, routing_finalize, routing_clear, routing_names, routing_xios_initialize 61 61 62 62 !! PARAMETERS … … 464 464 !! This routine gives a diagnostic of the basins used. 465 465 CALL routing_diagnostic_p(nbpt, index, lalo, resolution, contfrac, hist_id, hist2_id) 466 466 467 467 END SUBROUTINE routing_initialize 468 469 !! ============================================================================================================================= 470 !! SUBROUTINE: routing_xios_initialize 471 !! 472 !>\BRIEF Initialize xios dependant defintion before closing context defintion 473 !! 474 !! DESCRIPTION: Initialize xios dependant defintion before closing context defintion. 475 !! This subroutine is called before the xios context is closed. 476 !! 477 !! RECENT CHANGE(S): None 478 !! 479 !! REFERENCE(S): None 480 !! 481 !! FLOWCHART: None 482 !! \n 483 !_ ============================================================================================================================== 484 485 SUBROUTINE routing_xios_initialize 486 USE xios 487 IMPLICIT NONE 488 489 INTEGER(i_std) ::ib 490 491 ! Add axis for homogeneity between all routing schemes, these dimensions are currently not used in this scheme 492 CALL xios_orchidee_addaxis("nbhtu", nbasmax, (/(REAL(ib,r_std),ib=1,nbasmax)/)) 493 CALL xios_orchidee_addaxis("nbasmon", 1, (/(REAL(ib,r_std),ib=1,1)/)) 494 495 END SUBROUTINE routing_xios_initialize 468 496 469 497 !! ================================================================================================================================ -
branches/ORCHIDEE_2_2/ORCHIDEE/src_sechiba/routing_simple.f90
r7481 r7576 351 351 IMPLICIT NONE 352 352 353 INTEGER(i_std) ::ib 354 353 355 !! 0 Variable and parameter description 354 356 CHARACTER(LEN=60),ALLOCATABLE :: label(:) … … 363 365 IF (file_exists) CALL xios_set_file_attr("routing_start", enabled=.TRUE.) 364 366 ENDIF 367 368 !! Define XIOS axis size needed for the model output 369 ! Add axis for homogeneity between all routing schemes, these dimensions are currently not used in this scheme 370 CALL xios_orchidee_addaxis("nbhtu", nbasmax, (/(REAL(ib,r_std),ib=1,nbasmax)/)) 371 CALL xios_orchidee_addaxis("nbasmon", 1, (/(REAL(ib,r_std),ib=1,1)/)) 365 372 366 373 END SUBROUTINE routing_simple_xios_initialize -
branches/ORCHIDEE_2_2/ORCHIDEE/src_sechiba/routing_wrapper.f90
r6102 r7576 15 15 !! available routing modules: 16 16 !! - ROUTING_METOD=standard for the standard routing scheme available in module routing. 17 !! - ROUTING_METHOD=simple for the routing scheme in module routing_simple. 17 !! - ROUTING_METHOD=simple for the routing scheme in module routing_simple. 18 !! - ROUTING_METHOD=highres for the high resolution routing scheme in module routing_highres. 18 19 !! 19 20 !! REFERENCE(S) : None … … 32 33 USE grid 33 34 USE routing 35 USE routing_highres 34 36 USE routing_simple 35 37 36 38 IMPLICIT NONE 37 39 38 CHARACTER(LEN=255), SAVE :: routing_method !! 'standard' or 'simple': Character string used to switch between routing modules40 CHARACTER(LEN=255), SAVE :: routing_method !! 'standard', 'highres' or 'simple': Character string used to switch between routing modules 39 41 !$OMP THREADPRIVATE(routing_method) 40 42 … … 67 69 routing_method='standard' 68 70 CALL getin_p("ROUTING_METHOD",routing_method) 69 IF(routing_method=='simple') THEN 71 IF(routing_method=='standard') THEN 72 CALL routing_xios_initialize 73 ELSEIF(routing_method=='highres') THEN 74 CALL routing_highres_xios_initialize 75 ELSEIF(routing_method=='simple') THEN 70 76 CALL routing_simple_xios_initialize 71 77 ENDIF … … 144 150 145 151 CALL routing_initialize( kjit, nbpt, index, & 152 rest_id, hist_id, hist2_id, lalo, & 153 neighbours, resolution, contfrac, stempdiag, & 154 returnflow, reinfiltration, irrigation, riverflow, & 155 coastalflow, flood_frac, flood_res ) 156 157 ELSE IF (routing_method == 'highres') THEN 158 159 CALL routing_highres_initialize( kjit, nbpt, index, & 146 160 rest_id, hist_id, hist2_id, lalo, & 147 161 neighbours, resolution, contfrac, stempdiag, & … … 242 256 stempdiag, reinf_slope, returnflow, reinfiltration, irrigation, riverflow, coastalflow, rest_id, hist_id, hist2_id) 243 257 258 ELSE IF (routing_method=='highres') THEN 259 260 CALL routing_highres_main (kjit, nbpt, index, & 261 lalo, neighbours, resolution, contfrac, totfrac_nobio, veget_max, floodout, runoff, & 262 drainage, transpot, precip_rain, humrel, k_litt, flood_frac, flood_res, & 263 stempdiag, reinf_slope, returnflow, reinfiltration, irrigation, riverflow, coastalflow, rest_id, hist_id, hist2_id) 264 244 265 ELSE IF(routing_method=='simple') THEN 245 266 … … 287 308 CALL routing_finalize( kjit, nbpt, rest_id, flood_frac, flood_res ) 288 309 310 ELSE IF (routing_method=='highres') THEN 311 312 CALL routing_highres_finalize( kjit, nbpt, rest_id, flood_frac, flood_res ) 313 289 314 ELSE IF(routing_method=='simple') THEN 290 315 … … 316 341 CALL routing_clear 317 342 343 ELSE IF (routing_method=='highres') THEN 344 345 CALL routing_highres_clear 346 318 347 ELSE IF(routing_method=='simple') THEN 319 348 -
branches/ORCHIDEE_2_2/ORCHIDEE/src_xml/context_orchidee.xml
r7510 r7576 52 52 <reorder_domain invert_lat="true" shift_lon_fraction="0.5" min_lon="0" max_lon="360" /> 53 53 </domain> 54 54 55 55 </domain_definition> 56 56 … … 72 72 <axis id="nscm" name="nscm" standard_name="model_level_number" long_name="Soil type" unit="1"/> 73 73 <axis id="nsnow" name="snowlev" standard_name="model_level_number" long_name="Snow levels" unit="1"/> 74 <axis id="nbhtu" name="nbhtu" standard_name="model_level_number" long_name="HTU dimension for routing" unit="1"/> 75 <axis id="nbasmon" name="nbasmon" standard_name="model_level_number" long_name="HTU monitoring dimension" unit="1"/> 74 76 <axis id="P10" standard_name="model_level_number" long_name="Pool 10 years" unit="1"/> 75 77 <axis id="P100" standard_name="model_level_number" long_name="Pool 100 years" unit="1"/> … … 244 246 </grid> 245 247 248 <grid id="grid_nbhtu"> 249 <domain domain_ref="domain_landpoints" /> 250 <axis axis_ref="nbhtu" /> 251 </grid> 252 <grid id="grid_nbhtu_out"> 253 <domain domain_ref="domain_landpoints_out" /> 254 <axis axis_ref="nbhtu" /> 255 </grid> 256 257 <grid id="grid_nbasmon"> 258 <domain domain_ref="domain_landpoints" /> 259 <axis axis_ref="nbasmon" /> 260 </grid> 261 <grid id="grid_nbasmon_out"> 262 <domain domain_ref="domain_landpoints_out" /> 263 <axis axis_ref="nbasmon" /> 264 </grid> 265 246 266 247 267 <!-- Definition of grids with fields having two extra dimensions, 4D grids --> -
branches/ORCHIDEE_2_2/ORCHIDEE/src_xml/field_def_orchidee.xml
r7525 r7576 245 245 <field id="irrigmap" name="irrigmap" long_name="Map of irrigated areas" unit="m^2" operation="once" freq_offset="0ts"/> 246 246 <field id="floodmap" name="floodmap" long_name="Map of floodplains areas" unit="m^2" operation="once" freq_offset="0ts"/> 247 <field id="flood_frac" name="flood_frac" long_name="Flood Fraction" unit="1" /> 247 248 <field id="mask_coast" name="mask_coast" long_name="Mask of coastal gridcell which can recieve coastalflow" unit="" operation="once" freq_offset="0ts"/> 248 249 <field id="coastalflow" name="coastalflow" long_name="Diffuse coastal flow" unit="m^3/s"/> … … 251 252 <field id="riverflow_cpl" name="riverflow_cpl" long_name="River flow to the oceans, variable distributed over a time period before sent to ocean." unit="m^3/s"/> 252 253 <field id="hydrographs" name="hydrographs" long_name="Hydrographs of gridbox outflow" unit="m^3/s"/> 254 <field id="htuhgmon" name="htuhgmon" long_name="Hydrographs at monitored HTUs" unit="m^3/s" grid_ref="grid_nbasmon"/> 253 255 <field id="fastr" name="fastr" long_name="Fast flow reservoir" unit="kg/m^2"/> 254 256 <field id="slowr" name="slowr" long_name="Slow flow reservoir" unit="kg/m^2"/> … … 347 349 <field id="mrro_lut" name="mrroLut" long_name="Total runoff from land use tile" unit="kg m-2 s-1" grid_ref="grid_nlut"/> 348 350 <field id="gpplut" name="gppLut" long_name="Gross primary productivity on Landuse tiles" unit="kgC m-2 s-1" grid_ref="grid_nlut" /> 351 349 352 350 353 <!-- Varaibles interp_diag_xxx and interp_avail_xxx are written just after reading and interpolating from file and are used for validation --> -
branches/ORCHIDEE_2_2/ORCHIDEE/src_xml/file_def_orchidee.xml
r7525 r7576 74 74 <field field_ref="riversret" level="2"/> 75 75 <field field_ref="hydrographs" level="2"/> 76 <field field_ref="htuhgmon" name="HTUhydrographs" grid_ref="grid_nbasmon_out" level="2"/> 76 77 <field field_ref="vevapnu" name="evapnu" level="0" unit="mm/d" > @vevapnu*86400 </field> 77 78 <field field_ref="evap_bare_lim" level="2"/> … … 194 195 <field field_ref="irrigmap" level="8"/> 195 196 <field field_ref="floodmap" level="8"/> 197 <field field_ref="flood_frac" name="flood_frac" level="8"/> 196 198 <field field_ref="floodh" level="8"/> 197 199 <field field_ref="floodr" level="8"/> … … 463 465 <field field_ref="irrigmap" level="8"/> 464 466 <field field_ref="floodmap" level="8"/> 467 <field field_ref="flood_frac" name="flood_frac" level="8"/> 465 468 <field field_ref="swampmap" level="8"/> 466 469 … … 616 619 <field field_ref="irrigmap" name="IrrigationMap" level="1"/> 617 620 <field field_ref="floodmap" name="FloodplainsMap" level="1"/> 621 <field field_ref="flood_frac" name="flood_frac" level="1"/> 618 622 <field field_ref="swampmap" name="SwampMap" level="1"/> 619 623 <field field_ref="hydrographs" name="Dis" level="1"/> 624 <field field_ref="htuhgmon" name="HTUDis" grid_ref="grid_nbasmon_out" level="1"/> 620 625 <field field_ref="gpp" grid_ref="grid_nvm_out" name="GPP" level="1"/> 621 626 <field field_ref="nee" grid_ref="grid_nvm_out" name="NEE" level="1"/> … … 687 692 <field field_ref="irrigmap" name="IrrigationMap" level="1"/> 688 693 <field field_ref="floodmap" name="FloodplainsMap" level="1"/> 694 <field field_ref="flood_frac" name="flood_frac" level="1"/> 689 695 <field field_ref="swampmap" name="SwampMap" level="1"/> 690 696 <field field_ref="hydrographs" name="Dis" level="1"/>
Note: See TracChangeset
for help on using the changeset viewer.