| 1 | = Validation of the merge of Hydrology branch into the trunk = |
| 2 | |
| 3 | |
| 4 | |
| 5 | == Merge into the trunk (rev 941) (Didier Solyga) == |
| 6 | This section lists the modifications needed to merge the DOC/Hydro branch into the trunk : |
| 7 | |
| 8 | * hydrol : Move flag ok_throughfall_by_pft to pft_parameters : |
| 9 | {{{ |
| 10 | IF ( active_flags%hydrol_cwrr ) THEN |
| 11 | |
| 12 | !! 2.1 Read the flag ok_throughfall_by_pft to know if |
| 13 | !! we have to use the parameter throughfall_by_pft |
| 14 | |
| 15 | !Config Key = OK_THROUGHFALL_PFT |
| 16 | !Config Desc = Activate use of PERCENT_THROUGHFALL_PFT |
| 17 | !Config If = HYDROL_CWRR |
| 18 | !Config Def = FALSE |
| 19 | !Config Help = If NOT OFF_LINE_MODE it is always TRUE (coupled with a GCM) |
| 20 | !Config Units = [FLAG] |
| 21 | IF ( .NOT. OFF_LINE_MODE ) ok_throughfall_by_pft = .TRUE. |
| 22 | CALL getin_p('OK_THROUGHFALL_PFT',ok_throughfall_by_pft) |
| 23 | |
| 24 | END IF |
| 25 | |
| 26 | }}} |
| 27 | |
| 28 | |
| 29 | The pft parameter throughfall_by_pft is initiliazed and read in pft_parameters.f90. Correct memory allocation and initialization for parameter throughfall_by_pft : |
| 30 | |
| 31 | |
| 32 | {{{ |
| 33 | IF ( .NOT.(active_flags%hydrol_cwrr) .OR. (active_flags%hydrol_cwrr .AND. ok_throughfall_by_pft) ) THEN |
| 34 | ALLOCATE(throughfall_by_pft(nvm),stat=ier) |
| 35 | l_error = l_error .OR. (ier /= 0) |
| 36 | IF (l_error) THEN |
| 37 | WRITE(numout,*) ' Memory allocation error for throughfall_by_pft. We stop. We need nvm words = ',nvm |
| 38 | STOP 'pft_parameters_alloc' |
| 39 | END IF |
| 40 | END IF |
| 41 | }}} |
| 42 | |
| 43 | |
| 44 | |
| 45 | {{{ |
| 46 | IF ( .NOT.(active_flags%hydrol_cwrr) .OR. (active_flags%hydrol_cwrr .AND. ok_throughfall_by_pft) ) THEN |
| 47 | throughfall_by_pft(:) = throughfall_by_mtc(pft_to_mtc(:)) |
| 48 | ENDIF |
| 49 | |
| 50 | }}} |
| 51 | because throughfall_by_pft is still used with Choisnel hydrology but not automatically with CWRR. ===> '''Q: Inconsistency ?''' |
| 52 | |
| 53 | * pft_parameters : humcste has different default values according the value of dpu_max. We know that if we use the 11-layers hydrology, dpu_max should be set to 2 and humcste the corresponding values |
| 54 | {{{ |
| 55 | If (active_flags%hydrol_cwrr ) THEN |
| 56 | humcste(:) = humcste_cwrr(pft_to_mtc(:)) ! values for 2m soil depth |
| 57 | ELSE |
| 58 | humcste(:) = humcste_mtc(pft_to_mtc(:)) ! values for 4m soil depth |
| 59 | END IF |
| 60 | }}} |
| 61 | * constantes_soil : reintegrate the module constantes_soil. Add the corresponding "USE" in the code. The old hydrological parameters externalized which are obsolete now have been commented in constantes.f90. |
| 62 | dpu_max is set at 4 meters by default (value used for AR5 + Choisnel) |
| 63 | * intersurf : add a consistency test for dpu_max value. dpu_max can't be set to 4 if hydrol_cwrr is activated. |
| 64 | |
| 65 | {{{ |
| 66 | IF (control_flags%hydrol_cwrr .AND. (dpu_max /= 2.)) THEN |
| 67 | WRITE (numout,*) "You can not use the 11-layers hydrology with dpu_max /= 2. We set it to 2." |
| 68 | dpu_max = 2. |
| 69 | END IF |
| 70 | }}} |
| 71 | * routing : Add documentation. the following lines have been adapted for the externalization : |
| 72 | |
| 73 | |
| 74 | {{{ |
| 75 | DO ig = 1, nbpt |
| 76 | IF (MAXVAL(veget_max(ig,(nvm-3):nvm)) .GT. min_sechiba) THEN |
| 77 | DO jv = nvm-3, nvm |
| 78 | transpot_mean(ig) = transpot_mean(ig) + transpot(ig,jv) * veget_max(ig,jv)/ SUM(veget_max(ig,(nvm-3):nvm)) |
| 79 | ENDDO |
| 80 | ELSE |
| 81 | |
| 82 | }}} |
| 83 | The corresponding code now is : |
| 84 | |
| 85 | {{{ |
| 86 | tot_vegfrac_nowoody(:) = zero |
| 87 | DO jv = 1, nvm |
| 88 | IF (is_c3(jv) .OR. is_c4(jv)) THEN |
| 89 | tot_vegfrac_nowoody(:) = tot_vegfrac_nowoody(:) + veget_max(:,jv) |
| 90 | END IF |
| 91 | END DO |
| 92 | |
| 93 | DO ig = 1, nbpt |
| 94 | IF ( tot_vegfrac_nowoody(ig) .GT. min_sechiba ) THEN |
| 95 | DO jv = 1,nvm |
| 96 | IF ( is_c3(jv) .OR. is_c4(jv) ) THEN |
| 97 | transpot_mean(ig) = transpot_mean(ig) + transpot(ig,jv) * veget_max(ig,jv)/tot_vegfrac_nowoody(ig) |
| 98 | END IF |
| 99 | END DO |
| 100 | }}} |
| 101 | |
| 102 | * '''MERGE DONE ''': Merge Hydrology(+Doc) branch revision 932 into trunk revision 945. Done on 19/07/2012 look at [947]. |
| 103 | |
| 104 | === Differences explaining the differences between the trunk and the Hydrology branch : === |
| 105 | |
| 106 | * Initialization of lai : in the branch (and tag 196), the lai is initialized twice if we have no restart files, once in slowproc_lai, the second time in stomate.f90. In slowproc_lai, the lai is non-zero : |
| 107 | |
| 108 | {{{ |
| 109 | IF ( .NOT. read_lai ) THEN |
| 110 | |
| 111 | lai(: ,1) = zero |
| 112 | ! On boucle sur 2,nvm au lieu de 1,nvm |
| 113 | DO jv = 2,nvm |
| 114 | SELECT CASE (type_of_lai(jv)) |
| 115 | |
| 116 | CASE ("mean ") |
| 117 | ! |
| 118 | ! 1. do the interpolation between laimax and laimin |
| 119 | ! |
| 120 | lai(:,jv) = undemi * (llaimax(jv) + llaimin(jv)) |
| 121 | ! |
| 122 | CASE ("inter") |
| 123 | ! |
| 124 | ! 2. do the interpolation between laimax and laimin |
| 125 | ! |
| 126 | DO ji = 1,kjpindex |
| 127 | lai(ji,jv) = llaimin(jv) + tempfunc(stempdiag(ji,lcanop)) * (llaimax(jv) - llaimin(jv)) |
| 128 | ENDDO |
| 129 | ! |
| 130 | CASE default |
| 131 | ! |
| 132 | ! 3. Problem |
| 133 | ! |
| 134 | WRITE (numout,*) 'This kind of lai choice is not possible. '// & |
| 135 | ' We stop with type_of_lai ',jv,' = ', type_of_lai(jv) |
| 136 | STOP 'slowproc_lai' |
| 137 | |
| 138 | END SELECT |
| 139 | }}} |
| 140 | |
| 141 | but once in stomate_f90, it is recalculated : |
| 142 | |
| 143 | {{{ |
| 144 | IF (control%ok_pheno) THEN |
| 145 | !! 5.1.1 Update LAI |
| 146 | ! Set lai of bare soil to zero |
| 147 | lai(:,ibare_sechiba) = zero |
| 148 | ! lai for all PFTs |
| 149 | DO j = 2, nvm |
| 150 | lai(:,j) = biomass(:,j,ileaf)*sla(j) |
| 151 | ENDDO |
| 152 | ELSE |
| 153 | ! 5.1.2 Use a prescribed lai |
| 154 | ! WARNING: code in setlai is identical to the lines above |
| 155 | ! Update subroutine if LAI has to be forced |
| 156 | CALL setlai(kjpindex,lai) |
| 157 | ENDIF |
| 158 | }}} |
| 159 | |
| 160 | lai could be positive in sechiba but once in stomate, it could be equal to zero! It was inconsistent with the BVOC : we have isopren emissions without vegetation! I add the following line (see [890]) in slowproc (after calling slowproc_lai): |
| 161 | |
| 162 | {{{ |
| 163 | IF ( .NOT. read_lai ) THEN |
| 164 | lai(:,:) = zero |
| 165 | ENDIF |
| 166 | |
| 167 | }}} |
| 168 | This modification was not possible in slowproc_lai because the error occurs only when we don't use restart files. |
| 169 | * The second is the modification of solar module by N.Vuichard (see [861]) for using daily forcings. lhour is considered as a real and not an integer anymore. |
| 170 | * The sla parameter is calculated in Hydrology branch but prescribed in the trunk. The values are relatively the same but could explain some little differences. |
| 171 | * The CMOR outputs mrros, mrr, prveg, evspsblveg, evspsblsoi, tran have been corrected in the trunk (see ticket #9). Set SECHIBA_HIST_LEVEL to 10 to not activate them. |
| 172 | |
| 173 | === Differences explaining the differences between the trunk and the tag 196 : === |
| 174 | * In tag 196, when IMPOSE_VEG is activated veget is not calculated by the subroutine slowproc_veget. So as we have veget=veget_max, no fraction of bare soil is calculated. |
| 175 | * In trunk (rev [947]), veget(:,1) is replaced by tot_frac_bare and slowproc_veget is called whatever the case. So a fraction is always calculated even in IMPOSE_VEG. This modification implies a modification of the value of z0 (and albedo). To have the same results, a call to slowproc_veget should be added in the tag version of slowproc : |
| 176 | {{{ |
| 177 | ! |
| 178 | !Config Key = SLOWPROC_HEIGHT |
| 179 | !Config Desc = Height for all vegetation types |
| 180 | !Config Def = 0., 30., 30., 20., 20., 20., 15., 15., 15., .5, .6, 1.0, 1.0 |
| 181 | !Config If = OK_SECHIBA |
| 182 | !Config Help = The height used in the 0dim mode. The values should be found |
| 183 | !Config in the restart file. The new values of height will be computed anyway |
| 184 | !Config at the end of the current day. The need for this variable is caused |
| 185 | !Config by the fact that the model may stop during a day and thus we have not |
| 186 | !Config yet been through the routines which compute the new surface conditions. |
| 187 | !Config Units = [m] |
| 188 | ! |
| 189 | CALL setvar_p (height, val_exp, 'SLOWPROC_HEIGHT', height_presc) |
| 190 | |
| 191 | CALL slowproc_veget (kjpindex, lai, frac_nobio, veget_max, veget) |
| 192 | |
| 193 | ELSE |
| 194 | }}} |
| 195 | This line lets ORCHIDEE to calculate a fraction of bare soil even in IMPOSE_VEG. |