Changeset 272
- Timestamp:
- 2011-06-20T15:28:40+02:00 (13 years ago)
- Location:
- branches/ORCHIDEE_EXT/ORCHIDEE_OL
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/ORCHIDEE_EXT/ORCHIDEE_OL/forcesoil.f90
r258 r272 73 73 REAL(r_std),ALLOCATABLE :: carbon_loc(:,:,:) 74 74 INTEGER :: ierr 75 !>> DS add for externalization 76 LOGICAL :: l_error 77 ! >> DS 75 78 76 79 CALL Init_para(.FALSE.) 77 80 78 CALL getin_p('NVM',nvm) 81 ! 82 ! DS : For externalization cause we decoupled forcesoil from ORCHIDEE 83 ! 84 85 ! 1. Read the number of PFTs 86 CALL getin('NVM',nvm) 87 ! 2. Allocation 88 l_error = .FALSE. 89 ALLOCATE(pft_to_mtc(nvm),stat=ier) 90 l_error = l_error .OR. (ier .NE. 0) 91 IF (l_error) THEN 92 STOP 'pft_to_mtc (forcesoil only) : error in memory allocation' 93 ENDIF 94 95 ! 3. Initialisation of the correspondance table 96 pft_to_mtc (:) = undef_integer 97 98 ! 4.Reading of the conrrespondance table in the .def file 99 CALL getin('PFT_TO_MTC',pft_to_mtc) 100 101 ! 4.1 if nothing is found, we use the standard configuration 102 IF(nvm .EQ. 13 ) THEN 103 IF(pft_to_mtc(1) .EQ. undef_integer) THEN 104 WRITE(numout,*) 'Note to the user : we will use ORCHIDEE to its standard configuration' 105 pft_to_mtc(:) = (/ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13 /) 106 ENDIF 107 ELSE 108 IF(pft_to_mtc(1) .EQ. undef_integer) THEN 109 WRITE(numout,*)' The array PFT_TO_MTC is empty : we stop' 110 ENDIF 111 ENDIF 112 113 ! 5. What happened if pft_to_mtc(j) > nvmc (if the mtc doesn't exist)? 114 DO i = 1, nvm 115 IF(pft_to_mtc(i) .GT. nvmc) THEN 116 WRITE(numout,*) "the MTC you chose doesn't exist" 117 STOP 'we stop reading pft_to_mtc' 118 ENDIF 119 ENDDO 120 121 122 ! 6. Check if pft_to_mtc(1) = 1 123 IF(pft_to_mtc(1) .NE. 1) THEN 124 WRITE(numout,*) 'the first pft has to be the bare soil' 125 STOP 'we stop reading next values of pft_to_mtc' 126 ELSE 127 DO i = 2,nvm 128 IF(pft_to_mtc(i) .EQ.1) THEN 129 WRITE(numout,*) 'only pft_to_mtc(1) has to be the bare soil' 130 STOP 'we stop reading pft_to_mtc' 131 ENDIF 132 ENDDO 133 ENDIF 134 135 136 ! 7. Allocate and initialize natural ans is_c4 137 138 ! 7.1 Memory allocation 139 l_error = .FALSE. 140 ALLOCATE(natural(nvm),stat=ier) 141 l_error = l_error .OR. (ier .NE. 0) 142 ALLOCATE(is_c4(nvm),stat=ier) 143 144 IF (l_error) THEN 145 STOP 'natural or is_c4 (forcesoil only) : error in memory allocation' 146 ENDIF 147 148 ! 7.2 Initialisation 149 DO j= 1, nvm 150 natural(j) = natural_mtc(pft_to_mtc(j)) 151 is_c4(j) = is_c4_mtc(pft_to_mtc(j)) 152 ENDDO 153 79 154 !- 80 155 ! Stomate's restart files … … 112 187 !- 113 188 CALL bcast(date0) 114 !!! MM : Ãrevoir : choix du calendrier dans forcesoil ?? Il est dans le restart de stomate !189 !!! MM : à revoir : choix du calendrier dans forcesoil ?? Il est dans le restart de stomate ! 115 190 ! CALL ioconf_calendar ('noleap') 116 191 CALL ioget_calendar (one_year,one_day) … … 218 293 IF (m<10) part_str(1:1)='0' 219 294 var_name = 'carbon_'//part_str(1:LEN_TRIM(part_str)) 220 CALL restget &295 CALL restget_p & 221 296 & (rest_id_sto, var_name, kjpindex, ncarb , 1, itau_dep, & 222 297 & .TRUE., carbon(:,:,m), 'gather', kjpindex, indices) … … 325 400 IF (m<10) part_str(1:1)='0' 326 401 var_name = 'carbon_'//part_str(1:LEN_TRIM(part_str)) 327 CALL restput &402 CALL restput_p & 328 403 & (rest_id_sto, var_name, kjpindex, ncarb , 1, itau_dep, & 329 404 & carbon(:,:,m), 'scatter', kjpindex, indices) -
branches/ORCHIDEE_EXT/ORCHIDEE_OL/teststomate.f90
r258 r272 53 53 REAL(r_std),DIMENSION(:,:),ALLOCATABLE :: qsintmax_x 54 54 REAL(r_std),DIMENSION(:,:),ALLOCATABLE :: co2_flux 55 !!$ DS add for externalised version55 !!$ >> DS add for externalised version 56 56 REAL(r_std),DIMENSION(:),ALLOCATABLE :: hist_PFTaxis 57 !!$ DS57 !!$ >> DS 58 58 59 59 … … 75 75 CHARACTER(LEN=30) :: time_str 76 76 REAL :: hist_days_stom,hist_dt_stom 77 !!$ REAL,DIMENSION(nvm) :: hist_PFTaxis78 77 REAL(r_std),DIMENSION(10) :: hist_pool_10axis 79 78 REAL(r_std),DIMENSION(100) :: hist_pool_100axis … … 176 175 write(*,*) 'ATTENTION',dtradia,dt_force 177 176 178 !!$ DS added for the externalised version 179 !!$we need to know the pft parameters values used for stomate 177 !!$ >> DS added for the externalised version 178 !!$ we need to know the pft parameters values used for stomate 179 180 ! 1. Read the number of PFTs 181 CALL getin('NVM',nvm) 182 ! 2. Allocate and read the pft parameters stomate specific 180 183 CALL pft_parameters_main 181 184 CALL getin_stomate_pft_parameters … … 186 189 !- 187 190 a_er = .FALSE. 188 !!$ DS added for the externalised version 189 !!$ ALLOCATE (pft_to_mtc(nvm),stat=ier) 190 !!$ a_er = a_er .OR. (ier.NE.0) 191 !!$ >> DS added for the externalised version 191 192 ALLOCATE (hist_PFTaxis(nvm),stat=ier) 192 193 a_er = a_er .OR. (ier.NE.0) … … 356 357 control%ok_co2 = .TRUE. 357 358 control%ok_stomate = .TRUE. 358 !!$ DS now we search the values for the scalar parameters in orchidee.def359 !!$ >> DS now we search the values for the scalar parameters in some .def files 359 360 CALL getin_co2_parameters 360 361 CALL getin_stomate_parameters 361 !!$ CALL getin('CLAYFRACTION_DEFAULT',clayfraction_default)362 !!$ >> DS 362 363 !- 363 364 ! is DGVM activated? … … 366 367 CALL getin('STOMATE_OK_DGVM',control%ok_dgvm) 367 368 WRITE(*,*) 'LPJ is activated: ',control%ok_dgvm 368 !!$ DS for the externalisation reading the scalar parameters when ok_dgvm is set to true369 !!$ >> DS for the externalisation reading the scalar parameters when ok_dgvm is set to true 369 370 IF (control%ok_dgvm) THEN 370 371 CALL getin_dgvm_parameters 371 372 ENDIF 373 !!$ >> DS 372 374 !- 373 375 ! restart files … … 542 544 !- 543 545 544 ! DS : getin the value of slowproc parameters546 ! >> DS : getin the value of slowproc parameters 545 547 CALL getin('CLAYFRACTION_DEFAULT',clayfraction_default) 548 CALL getin('SOILTYPE_DEFAULT',soiltype_default) 549 ! >> DS 546 550 547 551 CALL slowproc_main &
Note: See TracChangeset
for help on using the changeset viewer.