| 14 | |
| 15 | == Work on convergence with sönke code == |
| 16 | |
| 17 | 1/ a problem when using the old photosynthesis. In diffuco_trans_co2 there where a divide by gstop not protected by a test gstop>0 |
| 18 | we have to replace: |
| 19 | ''DO inia=1,nia |
| 20 | |
| 21 | ! |
| 22 | |
| 23 | iainia=index_assi(inia) |
| 24 | |
| 25 | ! |
| 26 | |
| 27 | rveget(iainia,jv) = 1./gstop(iainia) |
| 28 | |
| 29 | ! |
| 30 | |
| 31 | ENDDO'' |
| 32 | |
| 33 | by |
| 34 | ''DO inia=1,nia |
| 35 | |
| 36 | ! |
| 37 | |
| 38 | iainia=index_assi(inia) |
| 39 | |
| 40 | ! |
| 41 | |
| 42 | IF (gstop(iainia) > min_sechiba) THEN |
| 43 | |
| 44 | rveget(iainia,jv) = 1./gstop(iainia) |
| 45 | |
| 46 | ELSE |
| 47 | |
| 48 | rveget(iainia,jv) = 1e5 |
| 49 | |
| 50 | ENDIF |
| 51 | |
| 52 | ! |
| 53 | |
| 54 | ENDDO'' |
| 55 | |
| 56 | and'' |
| 57 | |
| 58 | DO inia=1,nia |
| 59 | |
| 60 | ! |
| 61 | |
| 62 | iainia=index_assi(inia) |
| 63 | |
| 64 | ! |
| 65 | |
| 66 | ! rstruct is the difference between rtot (=1./gstot) and rveget |
| 67 | |
| 68 | ! |
| 69 | |
| 70 | rstruct(iainia,jv) = 1./gstot(iainia,jv) - & |
| 71 | |
| 72 | rveget(iainia,jv) |
| 73 | |
| 74 | ! |
| 75 | |
| 76 | ENDDO'' |
| 77 | |
| 78 | by |
| 79 | ''DO inia=1,nia |
| 80 | |
| 81 | ! |
| 82 | |
| 83 | iainia=index_assi(inia) |
| 84 | |
| 85 | ! |
| 86 | |
| 87 | ! rstruct is the difference between rtot (=1./gstot) and rveget |
| 88 | |
| 89 | ! |
| 90 | |
| 91 | IF (gstot(iainia,jv) > min_sechiba) THEN |
| 92 | |
| 93 | rstruct(iainia,jv) = 1./gstot(iainia,jv) - & |
| 94 | |
| 95 | rveget(iainia,jv) |
| 96 | |
| 97 | ELSE |
| 98 | |
| 99 | rstruct(iainia,jv) =0 |
| 100 | |
| 101 | ENDIF |
| 102 | |
| 103 | ! |
| 104 | |
| 105 | ENDDO'' |
| 106 | |
| 107 | |
| 108 | 2/ A problem in the first call to npp_calc. There is a line where scal = 1./ind(i,j) * cn_ind(i,j) whereas ind and cn_ind are not wet defined (so set to 0) |
| 109 | corrected by putting a return at the end of the initialisation block: |
| 110 | IF (firstcall) THEN ..... |
| 111 | |
| 112 | firstcall= .FALSE. |
| 113 | |
| 114 | RETURN |
| 115 | |
| 116 | ENDIF |
| 117 | |
| 118 | |
| 119 | 3/ Somethink which is probably very machine dependent but on titane whish is very very sensitive to precision problem (also when using simple precision) but anyway better to correct it: |
| 120 | in stomate_season there is a calculation of rue_longterm |
| 121 | '' ! |
| 122 | |
| 123 | ! 14.1 longterm radiation use efficiency |
| 124 | ! |
| 125 | DO j=2,nvm |
| 126 | WHERE(biomass(:,j,ileaf,icarbon)) .GT. min_stomate) |
| 127 | rue_longterm(:,j) = ( rue_longterm(:,j) * ( one_year - dt ) + & |
| 128 | gpp_daily(:,j) / (1. - exp(-0.5 * biomass(:,j,ileaf,icarbon)*sla(j))) * dt ) / (one_year) |
| 129 | ENDWHERE |
| 130 | ENDDO'' |
| 131 | in some case there is un FP error since (1. - exp(-0.5 * biomass(:,j,ileaf,icarbon)*sla(j))) * dt ) is probably near 0 |
| 132 | so I replaced the: |
| 133 | '' WHERE(biomass(:,j,ileaf,icarbon)) .GT. min_stomate) |
| 134 | '' |
| 135 | by |
| 136 | '' WHERE((1. - exp(-0.5 * biomass(:,j,ileaf,icarbon)*sla(j))) .GT. min_stomate) |
| 137 | '' |
| 138 | |