Changeset 277
- Timestamp:
- 2011-06-23T11:25:25+02:00 (14 years ago)
- Location:
- branches/ORCHIDEE_EXT/ORCHIDEE
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/ORCHIDEE_EXT/ORCHIDEE/src_sechiba/intersurf.f90
r257 r277 7 7 !! 8 8 !! @call sechiba_main 9 !! @Version : $Revision: 2 21 $, $Date: 2011-05-16 17:26:17 +0200 (Mon, 16 May2011) $9 !! @Version : $Revision: 275 $, $Date: 2011-06-21 15:28:18 +0200 (Tue, 21 Jun 2011) $ 10 10 !! 11 11 !! @author Marie-Alice Foujols and Jan Polcher 12 12 !! 13 13 !< $HeadURL: http://forge.ipsl.jussieu.fr/orchidee/svn/trunk/ORCHIDEE/src_sechiba/intersurf.f90 $ 14 !< $Date: 2011-0 5-16 17:26:17 +0200 (Mon, 16 May2011) $14 !< $Date: 2011-06-21 15:28:18 +0200 (Tue, 21 Jun 2011) $ 15 15 !< $Author: martial.mancip $ 16 !< $Revision: 2 21$16 !< $Revision: 275 $ 17 17 !! IPSL (2006) 18 18 !! This software is governed by the CeCILL licence see ORCHIDEE/ORCHIDEE_CeCILL.LIC … … 162 162 REAL(r_std),DIMENSION (kjpindex) :: dcoastal !! Work array to keep coastalflow 163 163 REAL(r_std),DIMENSION (kjpindex) :: driver !! Work array to keep riverflow 164 REAL(r_std),DIMENSION (kjpindex) :: znetco2 !! Work array to keep netco2flux 165 REAL(r_std),DIMENSION (kjpindex) :: zcarblu !! Work array to keep fco2_land_use 164 166 REAL(r_std),DIMENSION (kjpindex) :: ztsol_rad !! Work array to keep tsol_rad 165 167 REAL(r_std),DIMENSION (kjpindex) :: zvevapp !! Work array to keep vevapp … … 357 359 & zprecip_rain ,zprecip_snow, zlwdown, zswnet, zswdown, zpb, & 358 360 ! Output : Fluxes 359 & zvevapp, zfluxsens, zfluxlat, zcoastal, zriver, &361 & zvevapp, zfluxsens, zfluxlat, zcoastal, zriver, znetco2, zcarblu, & 360 362 ! Surface temperatures and surface properties 361 363 & ztsol_rad, ztemp_sol_new, zqsurf, zalbedo, zemis, zz0, & … … 701 703 REAL(r_std),DIMENSION (kjpindex) :: dcoastal !! Work array to keep coastal flow 702 704 REAL(r_std),DIMENSION (kjpindex) :: driver !! Work array to keep river out flow 705 REAL(r_std),DIMENSION (kjpindex) :: znetco2 !! Work array to keep netco2flux 706 REAL(r_std),DIMENSION (kjpindex) :: zcarblu !! Work array to keep fco2_land_use 703 707 REAL(r_std),DIMENSION (kjpindex) :: ztsol_rad !! Work array to keep tsol_rad 704 708 REAL(r_std),DIMENSION (kjpindex) :: zvevapp !! Work array to keep vevapp … … 874 878 & zprecip_rain ,zprecip_snow, zlwdown, zswnet, zswdown, zpb, & 875 879 ! Output : Fluxes 876 & zvevapp, zfluxsens, zfluxlat, zcoastal, zriver, &880 & zvevapp, zfluxsens, zfluxlat, zcoastal, zriver, znetco2, zcarblu, & 877 881 ! Surface temperatures and surface properties 878 882 & ztsol_rad, ztemp_sol_new, zqsurf, zalbedo, zemis, zz0, & … … 1211 1215 REAL(r_std),DIMENSION (kjpindex) :: dcoastal !! Work array to keep coastal flow 1212 1216 REAL(r_std),DIMENSION (kjpindex) :: driver !! Work array to keep river out flow 1217 REAL(r_std),DIMENSION (kjpindex) :: znetco2 !! Work array to keep netco2flux 1218 REAL(r_std),DIMENSION (kjpindex) :: zcarblu !! Work array to keep fco2_land_use 1213 1219 REAL(r_std),DIMENSION (kjpindex) :: ztsol_rad !! Work array to keep tsol_rad 1214 1220 REAL(r_std),DIMENSION (kjpindex) :: zvevapp !! Work array to keep vevapp … … 1571 1577 & zprecip_rain ,zprecip_snow, lwdown, swnet, swdown, pb, & 1572 1578 ! Output : Fluxes 1573 & zvevapp, zfluxsens, zfluxlat, zcoastal, zriver, &1579 & zvevapp, zfluxsens, zfluxlat, zcoastal, zriver, znetco2, zcarblu, & 1574 1580 ! Surface temperatures and surface properties 1575 1581 & ztsol_rad, ztemp_sol_new, zqsurf, zalbedo, zemis, zz0, & … … 1850 1856 & tsol_rad, temp_sol_new, qsurf, albedo, emis, z0, lon_scat_g, lat_scat_g, & 1851 1857 ! Ajout Nathalie - passage q2m/t2m pour calcul Rveget 1852 & q2m, t2m) 1858 & q2m, t2m, & 1859 ! Add emission/deposit fields 1860 & field_out_names, fields_out, field_in_names, fields_in) 1853 1861 #else 1854 1862 SUBROUTINE intersurf_gathered_2m (kjit, iim_glo, jjm_glo, kjpindex, kindex, xrdt, & … … 1866 1874 & tsol_rad, temp_sol_new, qsurf, albedo, emis, z0, lon_scat_g, lat_scat_g, & 1867 1875 ! Ajout Nathalie - passage q2m/t2m pour calcul Rveget 1868 & q2m, t2m) 1876 & q2m, t2m, & 1877 ! Add emission/deposit fields 1878 & field_out_names, fields_out, field_in_names, fields_in) 1869 1879 #endif 1870 1880 ! routines called : sechiba_main … … 1925 1935 REAL(r_std),DIMENSION (kjpindex), INTENT(out) :: fluxlat !! Latent chaleur flux 1926 1936 REAL(r_std),DIMENSION (kjpindex), INTENT(out) :: emis !! Emissivity 1937 ! 1938 ! Optional arguments 1939 ! 1940 ! Names and fields for emission variables : to be transport by GCM to chemistry model. 1941 CHARACTER(LEN=*),DIMENSION(:), OPTIONAL, INTENT(IN) :: field_out_names 1942 REAL(r_std),DIMENSION(:,:), OPTIONAL, INTENT(OUT) :: fields_out 1943 ! 1944 ! Names and fields for deposit variables : to be transport from chemistry model by GCM to ORCHIDEE. 1945 CHARACTER(LEN=*),DIMENSION(:), OPTIONAL, INTENT(IN) :: field_in_names 1946 REAL(r_std),DIMENSION(:,:), OPTIONAL, INTENT(IN) :: fields_in 1947 ! 1927 1948 ! LOCAL declaration 1928 1949 ! work arrays to scatter and/or gather information just before/after sechiba_main call's … … 1937 1958 REAL(r_std),DIMENSION (kjpindex) :: dcoastal !! Work array to keep coastal flow 1938 1959 REAL(r_std),DIMENSION (kjpindex) :: driver !! Work array to keep river out flow 1960 REAL(r_std),DIMENSION (kjpindex) :: znetco2 !! Work array to keep netco2flux 1961 REAL(r_std),DIMENSION (kjpindex) :: zcarblu !! Work array to keep fco2_land_use 1939 1962 REAL(r_std),DIMENSION (kjpindex) :: ztsol_rad !! Work array to keep tsol_rad 1940 1963 REAL(r_std),DIMENSION (kjpindex) :: zvevapp !! Work array to keep vevapp … … 1948 1971 ! Optional arguments 1949 1972 ! 1950 REAL(r_std),DIMENSION (iim_glo,jjm_glo), INTENT(IN) , OPTIONAL:: lon_scat_g, lat_scat_g !! The scattered values for longitude1973 REAL(r_std),DIMENSION (iim_glo,jjm_glo), INTENT(IN) :: lon_scat_g, lat_scat_g !! The scattered values for longitude 1951 1974 ! 1952 1975 INTEGER(i_std) :: iim,jjm !! local sizes … … 1980 2003 LOGICAL, SAVE :: fatmco2 !! Flag to force the value of atmospheric CO2 for vegetation. 1981 2004 REAL(r_std), SAVE :: atmco2 !! atmospheric CO2 2005 ! 2006 ! Number of fields to give (nb_fields_out) or get from (nb_fields_in) GCM : 2007 INTEGER(i_std), SAVE :: nb_fields_out, nb_fields_in 2008 ! Id of fields to give (nb_fields_out) or get from (nb_fields_in) GCM : 2009 INTEGER(i_std) :: i_fields_out, i_fields_in 1982 2010 ! 1983 2011 CALL ipslnlf(old_number=old_fileout) … … 2063 2091 ! we have to do the work here. 2064 2092 ! 2065 IF ( PRESENT(lon_scat_g) .AND. PRESENT(lat_scat_g)) THEN2093 IF ( .TRUE. ) THEN 2066 2094 2067 2095 lon_scat(:,:)=zero … … 2081 2109 lat_g(:,:) = lat_scat_g(:,:) 2082 2110 ENDIF 2083 2084 ELSE IF ( PRESENT(lon_scat_g) .OR. PRESENT(lat_scat_g)) THEN2085 2086 WRITE(numout,*) 'You need to provide the longitude AND latitude on the'2087 WRITE(numout,*) 'gathered grid in order to start ORCHIDEE.'2088 STOP 'intersurf_gathered'2089 2111 2090 2112 ELSE … … 2198 2220 ENDIF 2199 2221 ! 2222 2223 ! Prepare fieds out/in for interface with GCM. 2224 IF (PRESENT(field_out_names)) THEN 2225 nb_fields_out=SIZE(field_out_names) 2226 ELSE 2227 nb_fields_out=0 2228 ENDIF 2229 IF (PRESENT(field_in_names)) THEN 2230 nb_fields_in=SIZE(field_in_names) 2231 ELSE 2232 nb_fields_in=0 2233 ENDIF 2234 2200 2235 IF ( check ) WRITE(numout,*) 'End of Initialisation of intersurf' 2201 2236 ! … … 2251 2286 WRITE(numout,*) "Fraction of continent in the grid = ",zcontfrac 2252 2287 ENDIF 2288 2289 2290 ! Fields for deposit variables : to be transport from chemistry model by GCM to ORCHIDEE. 2291 WRITE(numout,*) "Get fields from atmosphere." 2292 2293 DO i_fields_in=1,nb_fields_in 2294 WRITE(numout,*) i_fields_in," Champ = ",TRIM(field_in_names(i_fields_in)) 2295 SELECT CASE(TRIM(field_in_names(i_fields_in))) 2296 CASE DEFAULT 2297 CALL ipslerr (3,'intsurf_gathered_2m', & 2298 & 'You ask in GCM an unknown field '//TRIM(field_in_names(i_fields_in))//& 2299 & ' to give to ORCHIDEE for this specific version.',& 2300 & 'This model won''t be able to continue.', & 2301 & '(check your tracer parameters in GCM)') 2302 END SELECT 2303 ENDDO 2304 2253 2305 ! 2254 2306 ! 2. modification of co2 … … 2301 2353 & zprecip_rain ,zprecip_snow, lwdown, swnet, swdown, pb, & 2302 2354 ! Output : Fluxes 2303 & zvevapp, zfluxsens, zfluxlat, zcoastal, zriver, &2355 & zvevapp, zfluxsens, zfluxlat, zcoastal, zriver, znetco2, zcarblu, & 2304 2356 ! Surface temperatures and surface properties 2305 2357 & ztsol_rad, ztemp_sol_new, zqsurf, zalbedo, zemis, zz0, & … … 2553 2605 riverflow(ik) = riverflow(ik)/xrdt 2554 2606 2607 ENDDO 2608 ! 2609 WRITE(numout,*) "Give fields to atmosphere." 2610 2611 ! Fields for emission variables : to be transport by GCM to chemistry model. 2612 DO i_fields_out=1,nb_fields_out 2613 SELECT CASE(TRIM(field_out_names(i_fields_out))) 2614 CASE("fCO2_land") 2615 fields_out(:,i_fields_out)=znetco2(:) 2616 CASE("fCO2_land_use") 2617 fields_out(:,i_fields_out)=zcarblu(:) 2618 CASE DEFAULT 2619 CALL ipslerr (3,'intsurf_gathered_2m', & 2620 & 'You ask from GCM an unknown field '//TRIM(field_out_names(i_fields_out))//& 2621 & ' to ORCHIDEE for this specific version.',& 2622 & 'This model won''t be able to continue.', & 2623 & '(check your tracer parameters in GCM)') 2624 END SELECT 2555 2625 ENDDO 2556 2626 ! -
branches/ORCHIDEE_EXT/ORCHIDEE/src_sechiba/routing.f90
r64 r277 19 19 !! 20 20 !! @author Jan Polcher 21 !! @Version : $Revision: 1.41 $, $Date: 2009/01/07 13:39:45$21 !! @Version : $Revision: 274 $, $Date: 2011-06-21 15:18:18 +0200 (Tue, 21 Jun 2011) $ 22 22 !! 23 !! $Header: /home/ssipsl/CVSREP/ORCHIDEE/src_sechiba/routing.f90,v 1.41 2009/01/07 13:39:45 ssipsl Exp $ 23 !< $HeadURL: http://forge.ipsl.jussieu.fr/orchidee/svn/trunk/ORCHIDEE/src_sechiba/routing.f90 $ 24 !< $Date: 2011-06-21 15:18:18 +0200 (Tue, 21 Jun 2011) $ 25 !< $Author: martial.mancip $ 26 !< $Revision: 274 $ 24 27 !! IPSL (2006) 25 28 !! This software is governed by the CeCILL licence see ORCHIDEE/ORCHIDEE_CeCILL.LIC … … 285 288 DO ig=1,nbpt 286 289 IF ( lalo(ig,1) > 49.0 ) THEN 287 floodtemp(ig) = tp_00 - 1.290 floodtemp(ig) = tp_00 - un 288 291 ENDIF 289 292 ENDDO … … 499 502 !Config If = RIVER_ROUTING 500 503 !Config Desc = Time step of th routing scheme 501 !Config Def = 86400504 !Config Def = one_day 502 505 !Config Help = This values gives the time step in seconds of the routing scheme. 503 506 !Config It should be multiple of the main time step of ORCHIDEE. One day … … 569 572 CALL restget (rest_id, var_name, 1, 1, 1, kjit, .TRUE., tmp_day) 570 573 time_counter = tmp_day(1) 571 CALL setvar (time_counter, val_exp, 'NO_KEYWORD', 0.0_r_std)574 CALL setvar (time_counter, val_exp, 'NO_KEYWORD', zero) 572 575 ENDIF 573 576 CALL bcast(time_counter) 574 !!$ CALL setvar_p (time_counter, val_exp, 'NO_KEYWORD', 0.0_r_std)577 !!$ CALL setvar_p (time_counter, val_exp, 'NO_KEYWORD', zero) 575 578 576 579 ! … … 650 653 CALL ioconf_setatt('LONG_NAME','Water in the fast reservoir') 651 654 CALL restget_p (rest_id, var_name, nbp_glo, nbasmax, 1, kjit, .TRUE., fast_reservoir, "gather", nbp_glo, index_g) 652 CALL setvar_p (fast_reservoir, val_exp, 'NO_KEYWORD', 0.0_r_std)655 CALL setvar_p (fast_reservoir, val_exp, 'NO_KEYWORD', zero) 653 656 ! 654 657 ALLOCATE (slow_reservoir(nbpt,nbasmax)) … … 657 660 CALL ioconf_setatt('LONG_NAME','Water in the slow reservoir') 658 661 CALL restget_p (rest_id, var_name, nbp_glo, nbasmax, 1, kjit, .TRUE., slow_reservoir, "gather", nbp_glo, index_g) 659 CALL setvar_p (slow_reservoir, val_exp, 'NO_KEYWORD', 0.0_r_std)662 CALL setvar_p (slow_reservoir, val_exp, 'NO_KEYWORD', zero) 660 663 ! 661 664 ALLOCATE (stream_reservoir(nbpt,nbasmax)) … … 664 667 CALL ioconf_setatt('LONG_NAME','Water in the stream reservoir') 665 668 CALL restget_p (rest_id, var_name, nbp_glo, nbasmax, 1, kjit, .TRUE., stream_reservoir, "gather", nbp_glo, index_g) 666 CALL setvar_p (stream_reservoir, val_exp, 'NO_KEYWORD', 0.0_r_std)669 CALL setvar_p (stream_reservoir, val_exp, 'NO_KEYWORD', zero) 667 670 ! 668 671 ALLOCATE (lake_reservoir(nbpt)) … … 671 674 CALL ioconf_setatt('LONG_NAME','Water in the lake reservoir') 672 675 CALL restget_p (rest_id, var_name, nbp_glo, 1, 1, kjit, .TRUE., lake_reservoir, "gather", nbp_glo, index_g) 673 CALL setvar (lake_reservoir, val_exp, 'NO_KEYWORD', 0.0_r_std)676 CALL setvar_p (lake_reservoir, val_exp, 'NO_KEYWORD', zero) 674 677 ! 675 678 ! Map of irrigated areas … … 689 692 CALL ioconf_setatt('LONG_NAME','Previous outflow from this basin') 690 693 CALL restget_p (rest_id, var_name, nbp_glo, nbasmax+3, 1, kjit, .TRUE., previous_outflow, "gather", nbp_glo, index_g) 691 CALL setvar_p (previous_outflow, val_exp, 'NO_KEYWORD', 0.0_r_std)694 CALL setvar_p (previous_outflow, val_exp, 'NO_KEYWORD', zero) 692 695 ! 693 696 IF ( dofloodplains ) THEN … … 707 710 CALL ioconf_setatt('LONG_NAME','Lake inflow') 708 711 CALL restget_p (rest_id, var_name, nbp_glo, 1, 1, kjit, .TRUE., lakeinflow_mean, "gather", nbp_glo, index_g) 709 CALL setvar_p (lakeinflow_mean, val_exp, 'NO_KEYWORD', 0.0_r_std)712 CALL setvar_p (lakeinflow_mean, val_exp, 'NO_KEYWORD', zero) 710 713 ! 711 714 ALLOCATE (returnflow_mean(nbpt)) … … 714 717 CALL ioconf_setatt('LONG_NAME','Deep return flux') 715 718 CALL restget_p (rest_id, var_name, nbp_glo, 1, 1, kjit, .TRUE., returnflow_mean, "gather", nbp_glo, index_g) 716 CALL setvar_p (returnflow_mean, val_exp, 'NO_KEYWORD', 0.0_r_std)719 CALL setvar_p (returnflow_mean, val_exp, 'NO_KEYWORD', zero) 717 720 returnflow(:) = returnflow_mean(:) 718 721 ! … … 726 729 CALL ioconf_setatt('LONG_NAME','Artificial irrigation flux') 727 730 CALL restget_p (rest_id, var_name, nbp_glo, 1, 1, kjit, .TRUE., irrigation_mean, "gather", nbp_glo, index_g) 728 CALL setvar_p (irrigation_mean, val_exp, 'NO_KEYWORD', 0.0_r_std) 729 irrigation(:) = irrigation_mean(:) 730 ELSE 731 CALL setvar_p (irrigation_mean, val_exp, 'NO_KEYWORD', zero) 732 ELSE 731 733 irrigation_mean(:) = zero 732 734 ENDIF 735 irrigation(:) = irrigation_mean(:) 733 736 ! 734 737 ALLOCATE (riverflow_mean(nbpt)) … … 737 740 CALL ioconf_setatt('LONG_NAME','River flux into the sea') 738 741 CALL restget_p (rest_id, var_name, nbp_glo, 1, 1, kjit, .TRUE., riverflow_mean, "gather", nbp_glo, index_g) 739 CALL setvar_p (riverflow_mean, val_exp, 'NO_KEYWORD', 0.0_r_std)742 CALL setvar_p (riverflow_mean, val_exp, 'NO_KEYWORD', zero) 740 743 riverflow(:) = riverflow_mean(:) 741 744 ! … … 745 748 CALL ioconf_setatt('LONG_NAME','Diffuse flux into the sea') 746 749 CALL restget_p (rest_id, var_name, nbp_glo, 1, 1, kjit, .TRUE., coastalflow_mean, "gather", nbp_glo, index_g) 747 CALL setvar_p (coastalflow_mean, val_exp, 'NO_KEYWORD', 0.0_r_std)750 CALL setvar_p (coastalflow_mean, val_exp, 'NO_KEYWORD', zero) 748 751 coastalflow(:) = coastalflow_mean(:) 749 752 ! … … 759 762 CALL ioconf_setatt('LONG_NAME','Hydrograph at outlow of grid') 760 763 CALL restget_p (rest_id, var_name, nbp_glo, 1, 1, kjit, .TRUE., hydrographs, "gather", nbp_glo, index_g) 761 CALL setvar_p (hydrographs, val_exp, 'NO_KEYWORD', 0.0_r_std)764 CALL setvar_p (hydrographs, val_exp, 'NO_KEYWORD', zero) 762 765 ! 763 766 ! The diagnostic variables, they are initialized from the above restart variables. … … 799 802 CALL ioconf_setatt('LONG_NAME','Accumulated runoff for routing') 800 803 CALL restget_p (rest_id, var_name, nbp_glo, 1, 1, kjit, .TRUE., runoff_mean, "gather", nbp_glo, index_g) 801 CALL setvar_p (runoff_mean, val_exp, 'NO_KEYWORD', 0.0_r_std)804 CALL setvar_p (runoff_mean, val_exp, 'NO_KEYWORD', zero) 802 805 ! 803 806 ALLOCATE(drainage_mean(nbpt)) … … 806 809 CALL ioconf_setatt('LONG_NAME','Accumulated drainage for routing') 807 810 CALL restget_p (rest_id, var_name, nbp_glo, 1, 1, kjit, .TRUE., drainage_mean, "gather", nbp_glo, index_g) 808 CALL setvar_p (drainage_mean, val_exp, 'NO_KEYWORD', 0.0_r_std)811 CALL setvar_p (drainage_mean, val_exp, 'NO_KEYWORD', zero) 809 812 ! 810 813 ALLOCATE(evapot_mean(nbpt)) … … 813 816 CALL ioconf_setatt('LONG_NAME','Accumulated potential evaporation for routing') 814 817 CALL restget_p (rest_id, var_name, nbp_glo, 1, 1, kjit, .TRUE., evapot_mean, "gather", nbp_glo, index_g) 815 CALL setvar_p (evapot_mean, val_exp, 'NO_KEYWORD', 0.0_r_std)818 CALL setvar_p (evapot_mean, val_exp, 'NO_KEYWORD', zero) 816 819 ! 817 820 ALLOCATE(precip_mean(nbpt)) … … 820 823 CALL ioconf_setatt('LONG_NAME','Accumulated rain precipitation for irrigation') 821 824 CALL restget_p (rest_id, var_name, nbp_glo, 1, 1, kjit, .TRUE., precip_mean, "gather", nbp_glo, index_g) 822 CALL setvar_p (precip_mean, val_exp, 'NO_KEYWORD', 0.0_r_std)825 CALL setvar_p (precip_mean, val_exp, 'NO_KEYWORD', zero) 823 826 ! 824 827 ALLOCATE(humrel_mean(nbpt)) … … 827 830 CALL ioconf_setatt('LONG_NAME','Mean humrel for irrigation') 828 831 CALL restget_p (rest_id, var_name, nbp_glo, 1, 1, kjit, .TRUE., humrel_mean, "gather", nbp_glo, index_g) 829 CALL setvar_p (humrel_mean, val_exp, 'NO_KEYWORD', 1.0_r_std)832 CALL setvar_p (humrel_mean, val_exp, 'NO_KEYWORD', un) 830 833 ! 831 834 ALLOCATE(totnobio_mean(nbpt)) … … 834 837 CALL ioconf_setatt('LONG_NAME','Last Total fraction of no bio for irrigation') 835 838 CALL restget_p (rest_id, var_name, nbp_glo, 1, 1, kjit, .TRUE., totnobio_mean, "gather", nbp_glo, index_g) 836 CALL setvar_p (totnobio_mean, val_exp, 'NO_KEYWORD', 0.0_r_std)839 CALL setvar_p (totnobio_mean, val_exp, 'NO_KEYWORD', zero) 837 840 ! 838 841 ALLOCATE(vegtot_mean(nbpt)) … … 841 844 CALL ioconf_setatt('LONG_NAME','Last Total fraction of vegetation') 842 845 CALL restget_p (rest_id, var_name, nbp_glo, 1, 1, kjit, .TRUE., vegtot_mean, "gather", nbp_glo, index_g) 843 CALL setvar_p (vegtot_mean, val_exp, 'NO_KEYWORD', 1.0_r_std)846 CALL setvar_p (vegtot_mean, val_exp, 'NO_KEYWORD', un) 844 847 ! 845 848 ! … … 978 981 ! 979 982 ELSE 980 fast_flow(ig,ib) = 0.0981 slow_flow(ig,ib) = 0.0982 stream_flow(ig,ib) = 0.0983 fast_flow(ig,ib) = zero 984 slow_flow(ig,ib) = zero 985 stream_flow(ig,ib) = zero 983 986 ENDIF 984 987 inflow(ig,ib) = fast_flow(ig,ib) + slow_flow(ig,ib) + stream_flow(ig,ib) … … 994 997 potflood(ig,ib) = inflow(ig,ib) - previous_outflow(ig,ib) 995 998 ! 996 IF ( tobeflooded(ig) > 0. .AND. potflood(ig,ib) > 0..AND. floodtemp(ig) > tp_00 ) THEN999 IF ( tobeflooded(ig) > 0. .AND. potflood(ig,ib) > zero .AND. floodtemp(ig) > tp_00 ) THEN 997 1000 ! 998 1001 IF (routing_area(ig,ib) > tobeflooded(ig)) THEN 999 1002 floodindex = tobeflooded(ig) / routing_area(ig,ib) 1000 1003 ELSE 1001 floodindex = 1.01004 floodindex = un 1002 1005 ENDIF 1003 1006 ! … … 1033 1036 !ym mais n'est pas la plus efficace 1034 1037 1035 IF (is_root_prc) & 1036 ALLOCATE( fast_flow_g(nbp_glo, nbasmax), slow_flow_g(nbp_glo, nbasmax), & 1037 stream_flow_g(nbp_glo, nbasmax), floods_g(nbp_glo, nbasmax), wdelay_g(nbp_glo, nbasmax) ) 1038 IF (is_root_prc) THEN 1039 ALLOCATE( fast_flow_g(nbp_glo, nbasmax), slow_flow_g(nbp_glo, nbasmax), & 1040 stream_flow_g(nbp_glo, nbasmax), floods_g(nbp_glo, nbasmax), & 1041 wdelay_g(nbp_glo, nbasmax) ) 1042 ELSE 1043 ALLOCATE( fast_flow_g(1,1), slow_flow_g(1,1), & 1044 stream_flow_g(1, 1), floods_g(1,1), & 1045 wdelay_g(1,1) ) 1046 ENDIF 1038 1047 1039 1048 … … 1057 1066 ENDIF 1058 1067 1059 IF (is_root_prc) & 1060 DEALLOCATE( fast_flow_g, slow_flow_g, stream_flow_g, floods_g, wdelay_g ) 1061 1068 DEALLOCATE( fast_flow_g, slow_flow_g, stream_flow_g, floods_g, wdelay_g ) 1069 1062 1070 CALL scatter(transport_glo,transport) 1063 1071 … … 1115 1123 DO ig=1,nbpt 1116 1124 1117 IF ((vegtot(ig) .GT. 0.0) .AND. (humrel(ig) .LT. 0.99)) THEN1118 irrig_netereq(ig) = (irrigated(ig) / totarea(ig) ) * MAX( 0.0, &1125 IF ((vegtot(ig) .GT. zero) .AND. (humrel(ig) .LT. 0.99)) THEN 1126 irrig_netereq(ig) = (irrigated(ig) / totarea(ig) ) * MAX(zero, & 1119 1127 & crop_coef * evapot(ig) - & 1120 1128 & MAX(precip(ig)+returnflow(ig)-runoff(ig)-drainage(ig), zero) ) 1121 1129 irrig_netereq(ig) = 1 * irrig_netereq(ig) 1122 1130 1123 IF(irrig_netereq(ig).LT. 0.0) THEN1131 IF(irrig_netereq(ig).LT.zero) THEN 1124 1132 WRITE(numout,*) 'there is a probleme for irrig_netereq',ig,irrig_netereq(ig) 1125 1133 ENDIF … … 1133 1141 & stream_reservoir(ig,ib) + fast_reservoir(ig,ib) + slow_reservoir(ig,ib) ) 1134 1142 1135 slow_reservoir(ig,ib) = MAX( 0.0, slow_reservoir(ig,ib) + &1136 & MIN( 0.0, fast_reservoir(ig,ib) + MIN(0.0, stream_reservoir(ig,ib)-baseirrig(ig,ib))))1143 slow_reservoir(ig,ib) = MAX(zero, slow_reservoir(ig,ib) + & 1144 & MIN(zero, fast_reservoir(ig,ib) + MIN(zero, stream_reservoir(ig,ib)-baseirrig(ig,ib)))) 1137 1145 1138 fast_reservoir(ig,ib) = MAX( 0.0, &1139 & fast_reservoir(ig,ib) + MIN( 0.0, stream_reservoir(ig,ib)-baseirrig(ig,ib)))1140 stream_reservoir(ig,ib) = MAX( 0.0, stream_reservoir(ig,ib)-baseirrig(ig,ib) )1146 fast_reservoir(ig,ib) = MAX( zero, & 1147 & fast_reservoir(ig,ib) + MIN(zero, stream_reservoir(ig,ib)-baseirrig(ig,ib))) 1148 stream_reservoir(ig,ib) = MAX(zero, stream_reservoir(ig,ib)-baseirrig(ig,ib) ) 1141 1149 1142 IF(baseirrig(ig,ib) .LT. 0.0 .OR. slow_reservoir(ig,ib) .LT. 0.0.OR. &1143 & fast_reservoir(ig,ib) .LT. 0.0 .OR. stream_reservoir(ig,ib) .LT. 0.0) THEN1150 IF(baseirrig(ig,ib) .LT. zero .OR. slow_reservoir(ig,ib) .LT. zero .OR. & 1151 & fast_reservoir(ig,ib) .LT. zero .OR. stream_reservoir(ig,ib) .LT. zero) THEN 1144 1152 WRITE(numout,*) 'There is negative values related to irrigation', ig,ib,baseirrig(ig,ib), & 1145 1153 & slow_reservoir(ig,ib),fast_reservoir(ig,ib),stream_reservoir(ig,ib) … … 1378 1386 ! 1379 1387 nb_pts(:) = 0 1380 totarea(:) = 0.01388 totarea(:) = zero 1381 1389 hydrodiag(:,:) = 0 1382 1390 DO ig=1,nbpt … … 1427 1435 ! 1428 1436 ! 1429 basinmap(:) = 0.01437 basinmap(:) = zero 1430 1438 DO icc = 1, num_largest 1431 1439 ff = MAXLOC(totarea) … … 1445 1453 & topids(ff(1)), name_str(1:15), totarea(ff(1))/1.e6, nb_pts(ff(1)) 1446 1454 ENDIF 1447 totarea(ff(1)) = 0.01455 totarea(ff(1)) = zero 1448 1456 ENDDO 1449 1457 ! … … 1471 1479 WRITE(numout,*) 'Maximum topographic index :', MAXVAL(topo_resid) 1472 1480 ic = COUNT(topo_resid .GT. 0.) 1473 WRITE(numout,*) 'Mean topographic index :', SUM(topo_resid, MASK=topo_resid .GT. 0.)/ic1474 WRITE(numout,*) 'Minimum topographic index :', MINVAL(topo_resid, MASK=topo_resid .GT. 0.)1481 WRITE(numout,*) 'Mean topographic index :', SUM(topo_resid, MASK=topo_resid .GT. zero)/ic 1482 WRITE(numout,*) 'Minimum topographic index :', MINVAL(topo_resid, MASK=topo_resid .GT. zero) 1475 1483 ! 1476 1484 DEALLOCATE(pts) … … 1561 1569 ! 0.3 LOCAL 1562 1570 ! 1563 !1564 1571 CHARACTER(LEN=80) :: filename 1565 1572 INTEGER(i_std) :: iml, jml, lml, tml, fid, ib, ip, jp, fopt, lastjp, nbexp … … 1674 1681 nbexp = 0 1675 1682 ! 1676 min_topoind = MINVAL(topoindex, MASK=topoindex .LT. undef_sechiba- 1.)1683 min_topoind = MINVAL(topoindex, MASK=topoindex .LT. undef_sechiba-un) 1677 1684 ! 1678 1685 DO ip=1,iml … … 1890 1897 ! 1891 1898 ! 1892 ! Set everything to undef to locate easily empty points1893 !1894 trip_bx(:,:) = undef_int1895 basin_bx(:,:) = undef_int1896 topoind_bx(:,:) = undef_sechiba1897 area_bx(:,:) = undef_sechiba1898 hierarchy_bx(:,:) = undef_sechiba1899 !1900 1899 ! extract the information for this grid box 1901 1900 ! … … 2074 2073 INTEGER(i_std) :: ip, jp, ll(1), iloc, jloc 2075 2074 REAL(r_std) :: lonstr(nbvmax*nbvmax), latstr(nbvmax*nbvmax) 2075 ! 2076 ! 2077 ! Set everything to undef to locate easily empty points 2078 ! 2079 trip_bx(:,:) = undef_int 2080 basin_bx(:,:) = undef_int 2081 topoind_bx(:,:) = undef_sechiba 2082 area_bx(:,:) = undef_sechiba 2083 hierarchy_bx(:,:) = undef_sechiba 2076 2084 ! 2077 2085 IF ( sub_pts(ib) > 0 ) THEN … … 3177 3185 ! Compute the area of the basin 3178 3186 ! 3179 basin_area(ib,ij) = 0.03180 basin_hierarchy(ib,ij) = 0.03187 basin_area(ib,ij) = zero 3188 basin_hierarchy(ib,ij) = zero 3181 3189 ! 3182 3190 SELECT CASE (hierar_method) … … 3186 3194 ! 3187 3195 END SELECT 3188 basin_topoind(ib,ij) = 0.03196 basin_topoind(ib,ij) = zero 3189 3197 ! 3190 3198 DO iz=1,basin_sz(ij) … … 3299 3307 INTEGER(i_std) :: ff(1) 3300 3308 ! 3309 ! WARNING 3310 LOGICAL, PARAMETER :: check = .FALSE. 3311 ! ERRORS 3312 LOGICAL :: error1, error2, error3, error4, error5 3313 3314 error1=.FALSE. 3315 error2=.FALSE. 3316 error3=.FALSE. 3317 error4=.FALSE. 3318 error5=.FALSE. 3319 3301 3320 outflow_basin(:,:) = undef_int 3302 3321 inflow_number(:,:) = 0 … … 3373 3392 inflow_basin(inp, bop, inflow_number(inp,bop)) = sb 3374 3393 ELSE 3375 WRITE(numout,*) 'Increase nbvmax'3376 STOP 'routing_linkup'3394 error1=.TRUE. 3395 EXIT 3377 3396 ENDIF 3378 3397 ENDIF … … 3528 3547 dop = sp 3529 3548 bop = sbl 3530 IF (basin_hierarchy(sp,sb) .LT. basin_hierarchy(sp,sbl)) THEN 3531 WRITE(numout,*) '>>>>>>> POINT CORRECTED against hierarchy :',& 3532 & sp, sb, 'into', sbl 3549 IF (check) THEN 3550 IF (basin_hierarchy(sp,sb) .LT. basin_hierarchy(sp,sbl)) THEN 3551 WRITE(numout,*) '>>>>>>> POINT CORRECTED against hierarchy :',& 3552 & sp, sb, 'into', sbl 3553 ENDIF 3533 3554 ENDIF 3534 3555 ENDIF … … 3542 3563 ! 3543 3564 IF ( dop .EQ. undef_int .AND. bop .EQ. undef_int ) THEN 3544 WRITE(numout,*) 'Why are we here with point ', sp, sb 3545 WRITE(numout,*) 'Coodinates : (lon,lat) = ', lalo(sp,2), lalo(sp,1) 3546 WRITE(numout,*) 'Contfrac : = ', contfrac(sp) 3547 WRITE(numout,*) 'Local Basin ID :', basin_id(sp,1:basin_count(sp)) 3548 WRITE(numout,*) 'Local hierarchies :', basin_hierarchy(sp,1:basin_count(sp)) 3549 WRITE(numout,*) 'Local basin_flowdir :', basin_flowdir(sp,1:basin_count(sp)) 3550 WRITE(numout,*) 'Local outflowgrid :', outflow_grid(sp,1:basin_count(sp)) 3551 WRITE(numout,*) 'outflow_grid :', inp 3552 WRITE(numout,*) 'Coodinates outflow : (lon,lat) = ', lalo(inp,2), lalo(inp,1) 3553 WRITE(numout,*) 'Contfrac : = ', contfrac(inp) 3554 WRITE(numout,*) 'Outflow Basin ID :', basin_id(inp,1:basin_count(inp)) 3555 WRITE(numout,*) 'Outflow hierarchies :', basin_hierarchy(inp,1:basin_count(inp)) 3556 WRITE(numout,*) 'Outflow basin_flowdir :', basin_flowdir(inp,1:basin_count(inp)) 3557 WRITE(numout,*) 'Explored options +1 :', dp1, bp1, outdp1 3558 WRITE(numout,*) 'Explored +1 Basin ID :', basin_id(dp1,1:basin_count(dp1)) 3559 WRITE(numout,*) 'Explored +1 hierarchies :', basin_hierarchy(dp1,1:basin_count(dp1)) 3560 WRITE(numout,*) 'Explored +1 basin_flowdir :', basin_flowdir(dp1,1:basin_count(dp1)) 3561 WRITE(numout,*) 'Explored options -1 :', dm1, bm1, outdm1 3562 WRITE(numout,*) 'Explored -1 Basin ID :', basin_id(dm1,1:basin_count(dm1)) 3563 WRITE(numout,*) 'Explored -1 hierarchies :', basin_hierarchy(dm1,1:basin_count(dm1)) 3564 WRITE(numout,*) 'Explored -1 basin_flowdir :', basin_flowdir(dm1,1:basin_count(dm1)) 3565 WRITE(numout,*) '****************************' 3565 IF (check) THEN 3566 WRITE(numout,*) 'Why are we here with point ', sp, sb 3567 WRITE(numout,*) 'Coodinates : (lon,lat) = ', lalo(sp,2), lalo(sp,1) 3568 WRITE(numout,*) 'Contfrac : = ', contfrac(sp) 3569 WRITE(numout,*) 'Local Basin ID :', basin_id(sp,1:basin_count(sp)) 3570 WRITE(numout,*) 'Local hierarchies :', basin_hierarchy(sp,1:basin_count(sp)) 3571 WRITE(numout,*) 'Local basin_flowdir :', basin_flowdir(sp,1:basin_count(sp)) 3572 WRITE(numout,*) 'Local outflowgrid :', outflow_grid(sp,1:basin_count(sp)) 3573 WRITE(numout,*) 'outflow_grid :', inp 3574 WRITE(numout,*) 'Coodinates outflow : (lon,lat) = ', lalo(inp,2), lalo(inp,1) 3575 WRITE(numout,*) 'Contfrac : = ', contfrac(inp) 3576 WRITE(numout,*) 'Outflow Basin ID :', basin_id(inp,1:basin_count(inp)) 3577 WRITE(numout,*) 'Outflow hierarchies :', basin_hierarchy(inp,1:basin_count(inp)) 3578 WRITE(numout,*) 'Outflow basin_flowdir :', basin_flowdir(inp,1:basin_count(inp)) 3579 WRITE(numout,*) 'Explored options +1 :', dp1, bp1, outdp1 3580 WRITE(numout,*) 'Explored +1 Basin ID :', basin_id(dp1,1:basin_count(dp1)) 3581 WRITE(numout,*) 'Explored +1 hierarchies :', basin_hierarchy(dp1,1:basin_count(dp1)) 3582 WRITE(numout,*) 'Explored +1 basin_flowdir :', basin_flowdir(dp1,1:basin_count(dp1)) 3583 WRITE(numout,*) 'Explored options -1 :', dm1, bm1, outdm1 3584 WRITE(numout,*) 'Explored -1 Basin ID :', basin_id(dm1,1:basin_count(dm1)) 3585 WRITE(numout,*) 'Explored -1 hierarchies :', basin_hierarchy(dm1,1:basin_count(dm1)) 3586 WRITE(numout,*) 'Explored -1 basin_flowdir :', basin_flowdir(dm1,1:basin_count(dm1)) 3587 WRITE(numout,*) '****************************' 3588 ENDIF 3566 3589 IF ( contfrac(sp) > 0.01 ) THEN 3567 CALL ipslerr(3,'routing_linkup', & 3568 & 'In the routine which make connections between the basins and ensure global coherence,', & 3569 & 'there is a problem with outflow linkup without any valid direction.', & 3570 & '(Perhaps there is a problem with the grid.)') 3590 error2=.TRUE. 3591 EXIT 3571 3592 ENDIF 3572 3593 ENDIF … … 3585 3606 inflow_basin(dop, bop, inflow_number(dop,bop)) = sb 3586 3607 ELSE 3587 WRITE(numout,*) 'Increase nbvmax'3588 STOP 'routing_linkup'3608 error3=.TRUE. 3609 EXIT 3589 3610 ENDIF 3590 3611 ! … … 3605 3626 ! 3606 3627 3607 WRITE(numout,*) 'There is no reason to here, this part of the code should be dead :', sp,sb3608 3628 IF (check) & 3629 WRITE(numout,*) 'There is no reason to here, this part of the code should be dead :', sp,sb 3609 3630 ! 3610 3631 DO sbl=1,basin_count(sp) … … 3622 3643 IF ( inflow_number(sp,sbl) .LE. nbvmax ) THEN 3623 3644 IF ( sp .EQ. 42 .AND. sbl .EQ. 1) THEN 3624 WRITE(numout,*) 'ADD INFLOW (3):', sp, sb 3645 IF (check) & 3646 WRITE(numout,*) 'ADD INFLOW (3):', sp, sb 3625 3647 ENDIF 3626 3648 inflow_grid(sp, sbl, inflow_number(sp,sbl)) = sp 3627 3649 inflow_basin(sp, sbl, inflow_number(sp,sbl)) = sb 3628 3650 ELSE 3629 WRITE(numout,*) 'Increase nbvmax'3630 STOP 'routing_linkup'3651 error4=.TRUE. 3652 EXIT 3631 3653 ENDIF 3632 3654 ENDIF … … 3639 3661 & .AND. basin_flowdir(sp,sb) .GT. 0) THEN 3640 3662 ! 3641 WRITE(numout,*) 'We could not find the basin into which we need to flow' 3642 WRITE(numout,*) 'Grid point ', sp, ' and basin ', sb 3643 WRITE(numout,*) 'Explored neighbours :', dm1, dp1 3644 WRITE(numout,*) 'Outflow direction :', basin_flowdir(sp,sb) 3645 WRITE(numout,*) 'Outlfow grid :', outflow_grid(sp,sb) 3646 WRITE(numout,*) 'basin ID:',basin_id(sp,sb) 3647 WRITE(numout,*) 'Hierarchy :', basin_hierarchy(sp,sb) 3648 STOP 'routing_linkup' 3663 error5=.TRUE. 3664 EXIT 3649 3665 ENDIF 3650 3666 ENDDO 3651 3667 ! 3652 3668 ENDDO 3669 IF (error1) THEN 3670 WRITE(numout,*) " routing_linkup : bop .LT. undef_int",bop 3671 CALL ipslerr(3,'routing_linkup', & 3672 "bop .LT. undef_int",'Increase nbvmax','stop routing_linkup') 3673 ENDIF 3674 IF (error2) THEN 3675 CALL ipslerr(3,'routing_linkup', & 3676 & 'In the routine which make connections between the basins and ensure global coherence,', & 3677 & 'there is a problem with outflow linkup without any valid direction. Try with check=.TRUE.', & 3678 & '(Perhaps there is a problem with the grid.)') 3679 ENDIF 3680 IF (error3) THEN 3681 WRITE(numout,*) " routing_linkup : dop .GT. 0 .AND. dop .NE. undef_int",dop 3682 CALL ipslerr(3,'routing_linkup', & 3683 "dop .GT. 0 .AND. dop .NE. undef_int",'Increase nbvmax. Try with check=.TRUE.','stop routing_linkup') 3684 ENDIF 3685 IF (error4) THEN 3686 WRITE(numout,*) " routing_linkup : (sbl .NE. sb) .AND. (basin_id(sp,sbl) .EQ. bid) ", & 3687 & " .AND. (basin_hierarchy(sp,sb) .GT. basin_hierarchy(sp,sbl))",sbl,sb,basin_id(sp,sbl),bid, & 3688 & basin_hierarchy(sp,sb),basin_hierarchy(sp,sbl) 3689 CALL ipslerr(3,'routing_linkup', & 3690 "(sbl .NE. sb) .AND. (basin_id(sp,sbl) .EQ. bid) .AND. (basin_hierarchy(sp,sb) .GT. basin_hierarchy(sp,sbl))" & 3691 ,'Increase nbvmax. Try with check=.TRUE.','stop routing_linkup') 3692 ENDIF 3693 IF (error5) THEN 3694 WRITE(numout,*) 'We could not find the basin into which we need to flow' 3695 WRITE(numout,*) 'Grid point ', sp, ' and basin ', sb 3696 WRITE(numout,*) 'Explored neighbours :', dm1, dp1 3697 WRITE(numout,*) 'Outflow direction :', basin_flowdir(sp,sb) 3698 WRITE(numout,*) 'Outlfow grid :', outflow_grid(sp,sb) 3699 WRITE(numout,*) 'Outlfow basin :',outflow_basin(sp,sb) 3700 WRITE(numout,*) 'basin ID:',basin_id(sp,sb) 3701 WRITE(numout,*) 'Hierarchy :', basin_hierarchy(sp,sb) 3702 CALL ipslerr(3,'routing_linkup', & 3703 "We could not find the basin into which we need to flow",'Try with check=.TRUE.','stop routing_linkup') 3704 ENDIF 3653 3705 ! 3654 3706 ! Check for each outflow basin that it exists … … 3724 3776 ! Compute the area upstream of each basin 3725 3777 ! 3726 fetch_basin(:,:) = 0.03778 fetch_basin(:,:) = zero 3727 3779 ! 3728 3780 ! … … 3793 3845 ff = MAXLOC(tmp_area(1:nboutflow)) 3794 3846 outflow_grid(tmpindex(ff(1),1), tmpindex(ff(1),2)) = -1 3795 tmp_area(ff(1)) = 0.03847 tmp_area(ff(1)) = zero 3796 3848 ENDDO 3797 3849 ! … … 3944 3996 ! Now the take the smalest to be transfered to the largest 3945 3997 ! 3946 iml = MAXLOC(tmp_area(1:multbas), MASK = tmp_area(1:multbas) .GT. 0.)3998 iml = MAXLOC(tmp_area(1:multbas), MASK = tmp_area(1:multbas) .GT. zero) 3947 3999 sbas = multbas_sz(iml(1)) 3948 iml = MINLOC(tmp_area(1:multbas), MASK = tmp_area(1:multbas) .GT. 0.)4000 iml = MINLOC(tmp_area(1:multbas), MASK = tmp_area(1:multbas) .GT. zero) 3949 4001 kbas = multbas_sz(iml(1)) 3950 4002 ! … … 3991 4043 tmp_area(ii) = fetch_basin(ib, multbas_list(ik,ii)) 3992 4044 ENDDO 3993 iml = MAXLOC(tmp_area(1:multbas_sz(ik)), MASK = tmp_area(1:multbas_sz(ik)) .GT. 0.)4045 iml = MAXLOC(tmp_area(1:multbas_sz(ik)), MASK = tmp_area(1:multbas_sz(ik)) .GT. zero) 3994 4046 sbas = multbas_list(ik,iml(1)) 3995 iml = MINLOC(tmp_area(1:multbas_sz(ik)), MASK = tmp_area(1:multbas_sz(ik)) .GT. 0.)4047 iml = MINLOC(tmp_area(1:multbas_sz(ik)), MASK = tmp_area(1:multbas_sz(ik)) .GT. zero) 3996 4048 kbas = multbas_list(ik,iml(1)) 3997 4049 ! … … 4037 4089 ! If one of the basins goes to the ocean then it is going to have the priority 4038 4090 ! 4039 tmp_area(:) = 0.4091 tmp_area(:) = zero 4040 4092 IF ( COUNT(outflow_grid(ib,multbas_list(ik,1:multbas_sz(ik))) .LT. 0) .GT. 0) THEN 4041 4093 DO ii=1,multbas_sz(ik) … … 4047 4099 ENDDO 4048 4100 ! take the smalest of the subbasins 4049 iml = MINLOC(tmp_area(1:multbas_sz(ik)), MASK = tmp_area(1:multbas_sz(ik)) .GT. 0.)4101 iml = MINLOC(tmp_area(1:multbas_sz(ik)), MASK = tmp_area(1:multbas_sz(ik)) .GT. zero) 4050 4102 kbas = multbas_list(ik,iml(1)) 4051 4103 ELSE … … 4056 4108 tmp_area(ii) = fetch_basin(ib, multbas_list(ik,ii)) 4057 4109 ENDDO 4058 iml = MAXLOC(tmp_area(1:multbas_sz(ik)), MASK = tmp_area(1:multbas_sz(ik)) .GT. 0.)4110 iml = MAXLOC(tmp_area(1:multbas_sz(ik)), MASK = tmp_area(1:multbas_sz(ik)) .GT. zero) 4059 4111 sbas = multbas_list(ik,iml(1)) 4060 iml = MINLOC(tmp_area(1:multbas_sz(ik)), MASK = tmp_area(1:multbas_sz(ik)) .GT. 0.)4112 iml = MINLOC(tmp_area(1:multbas_sz(ik)), MASK = tmp_area(1:multbas_sz(ik)) .GT. zero) 4061 4113 kbas = multbas_list(ik,iml(1)) 4062 4114 ! … … 4147 4199 route_togrid(ib,:) = ib 4148 4200 route_tobasin(ib,:) = 0 4149 routing_area(ib,:) = 0.04201 routing_area(ib,:) = zero 4150 4202 ! 4151 4203 ENDDO … … 4210 4262 ! Verify areas of the contienents 4211 4263 ! 4212 floflo(:,:) = 0.04264 floflo(:,:) = zero 4213 4265 gridarea(:) = contfrac(:)*resolution(:,1)*resolution(:,2) 4214 4266 DO ib=1,nbpt … … 4249 4301 ! 4250 4302 DO ib=1,nbpt 4251 IF ( gridbasinarea(ib) > 0.) THEN4303 IF ( gridbasinarea(ib) > zero ) THEN 4252 4304 ratio = gridarea(ib)/gridbasinarea(ib) 4253 4305 routing_area(ib,:) = routing_area(ib,:)*ratio … … 4268 4320 largest_basins(ibf,:) = ff(:) 4269 4321 ENDIF 4270 floflo(ff(1), ff(2)) = 0.04322 floflo(ff(1), ff(2)) = zero 4271 4323 ENDDO 4272 4324 ! … … 4405 4457 basin_flowdir(ib, tokill:basin_count(ib)-1) = basin_flowdir(ib, tokill+1:basin_count(ib)) 4406 4458 basin_area(ib, tokill:basin_count(ib)-1) = basin_area(ib, tokill+1:basin_count(ib)) 4407 basin_area(ib, basin_count(ib):nwbas) = 0.04459 basin_area(ib, basin_count(ib):nwbas) = zero 4408 4460 basin_topoind(ib, tokill:basin_count(ib)-1) = basin_topoind(ib, tokill+1:basin_count(ib)) 4409 basin_topoind(ib, basin_count(ib):nwbas) = 0.04461 basin_topoind(ib, basin_count(ib):nwbas) = zero 4410 4462 fetch_basin(ib, tokill:basin_count(ib)-1) = fetch_basin(ib, tokill+1:basin_count(ib)) 4411 fetch_basin(ib, basin_count(ib):nwbas) = 0.04463 fetch_basin(ib, basin_count(ib):nwbas) = zero 4412 4464 ! 4413 4465 ! Before we remove the information from the outflow fields we have to correct the corresponding inflow fields … … 4919 4971 DO jp=1,jml 4920 4972 ! 4921 IF ( irrigated_frac(ip,jp) .LT. undef_sechiba- 1.) THEN4973 IF ( irrigated_frac(ip,jp) .LT. undef_sechiba-un) THEN 4922 4974 irrigated_frac(ip,jp) = irrigated_frac(ip,jp)/100. 4923 IF ( irrigated_frac(ip,jp) < 0.005 ) irrigated_frac(ip,jp) = 0.04975 IF ( irrigated_frac(ip,jp) < 0.005 ) irrigated_frac(ip,jp) = zero 4924 4976 ENDIF 4925 4977 ! 4926 IF ( flood_frac(ip,jp) .LT. undef_sechiba- 1.) THEN4978 IF ( flood_frac(ip,jp) .LT. undef_sechiba-un) THEN 4927 4979 flood_frac(ip,jp) = flood_frac(ip,jp)/100 4928 IF ( flood_frac(ip,jp) < 0.005 ) flood_frac(ip,jp) = 0.04980 IF ( flood_frac(ip,jp) < 0.005 ) flood_frac(ip,jp) = zero 4929 4981 ENDIF 4930 4982 ! … … 5082 5134 ENDIF 5083 5135 ! 5084 IF (flood_frac(ip,jp) .LT. undef_sechiba- 1.) THEN5136 IF (flood_frac(ip,jp) .LT. undef_sechiba-un) THEN 5085 5137 area_flood = area_flood + ax*ay*flood_frac(ip,jp) 5086 5138 ENDIF … … 5105 5157 ENDIF 5106 5158 ! Compute a diagnostic of the map. 5107 IF(contfrac(ib).GT. 0.0) THEN5159 IF(contfrac(ib).GT.zero) THEN 5108 5160 irrigmap (ib) = irrigated(ib) / ( resolution(ib,1)*resolution(ib,2)*contfrac(ib) ) 5109 5161 ELSE -
branches/ORCHIDEE_EXT/ORCHIDEE/src_sechiba/sechiba.f90
r257 r277 4 4 !! 5 5 !! @author Marie-Alice Foujols and Jan Polcher 6 !! @Version : $Revision: 45 $, $Date: 2011-01-01 21:30:44 +0100 (Sat, 01 Jan 2011) $6 !! @Version : $Revision: 275 $, $Date: 2011-06-21 15:28:18 +0200 (Tue, 21 Jun 2011) $ 7 7 !! 8 8 !< $HeadURL: http://forge.ipsl.jussieu.fr/orchidee/svn/trunk/ORCHIDEE/src_sechiba/sechiba.f90 $ 9 !< $Date: 2011-0 1-01 21:30:44 +0100 (Sat, 01 Jan 2011) $10 !< $Author: m maipsl$11 !< $Revision: 45 $9 !< $Date: 2011-06-21 15:28:18 +0200 (Tue, 21 Jun 2011) $ 10 !< $Author: martial.mancip $ 11 !< $Revision: 275 $ 12 12 !! IPSL (2006) 13 13 !! This software is governed by the CeCILL licence see ORCHIDEE/ORCHIDEE_CeCILL.LIC … … 186 186 & precip_rain, precip_snow, lwdown, swnet, swdown, pb, & 187 187 ! Output : Fluxes 188 & vevapp, fluxsens, fluxlat, coastalflow, riverflow, &188 & vevapp, fluxsens, fluxlat, coastalflow, riverflow, netco2flux, fco2_lu, & 189 189 ! Surface temperatures and surface properties 190 190 & tsol_rad, temp_sol_new, qsurf_out, albedo_out, emis_out, z0_out, & … … 249 249 REAL(r_std),DIMENSION (kjpindex), INTENT (out) :: fluxlat !! Latent chaleur flux 250 250 REAL(r_std),DIMENSION (kjpindex), INTENT (out) :: emis_out !! Emissivity 251 REAL(r_std),DIMENSION (kjpindex), INTENT (out) :: netco2flux !! Sum CO2 flux over PFTs (gC/m**2 of average ground/s) 252 REAL(r_std),DIMENSION (kjpindex), INTENT (out) :: fco2_lu !! Land Cover Change CO2 flux (gC/m**2 of average ground/s) 251 253 252 254 REAL(r_std), ALLOCATABLE, DIMENSION (:) :: runoff1,drainage1, soilcap1,soilflx1 … … 322 324 lai, height, veget, frac_nobio, veget_max, totfrac_nobio, qsintmax, & 323 325 rest_id, hist_id, hist2_id, rest_id_stom, hist_id_stom, hist_id_stom_IPCC, & 324 co2_flux) 326 co2_flux, fco2_lu) 327 netco2flux(:) = zero 328 DO jv = 2,nvm 329 netco2flux(:) = netco2flux(:) + co2_flux(:,jv)*veget_max(:,jv) 330 ENDDO 325 331 ! 326 332 ! computes initialisation of diffusion coeff … … 570 576 lai, height, veget, frac_nobio, veget_max, totfrac_nobio, qsintmax, & 571 577 rest_id, hist_id, hist2_id, rest_id_stom, hist_id_stom, hist_id_stom_IPCC, & 572 co2_flux) 573 578 co2_flux, fco2_lu) 579 ! 580 ! Compute global CO2 flux 581 ! 582 netco2flux(:) = zero 583 DO jv = 2,nvm 584 netco2flux(:) = netco2flux(:) + co2_flux(:,jv)*veget_max(:,jv) 585 ENDDO 574 586 ! 575 587 ! call swap from new computed variables … … 831 843 lai, height, veget, frac_nobio, veget_max, totfrac_nobio, qsintmax, & 832 844 rest_id, hist_id, hist2_id, rest_id_stom, hist_id_stom, hist_id_stom_IPCC, & 833 co2_flux) 834 845 co2_flux, fco2_lu) 846 netco2flux(:) = zero 847 DO jv = 2,nvm 848 netco2flux(:) = netco2flux(:) + co2_flux(:,jv)*veget_max(:,jv) 849 ENDDO 835 850 836 851 var_name= 'shumdiag' -
branches/ORCHIDEE_EXT/ORCHIDEE/src_sechiba/slowproc.f90
r257 r277 3 3 ! 4 4 !< $HeadURL: http://forge.ipsl.jussieu.fr/orchidee/svn/trunk/ORCHIDEE/src_sechiba/slowproc.f90 $ 5 !< $Date: 2011-0 1-01 21:30:44 +0100 (Sat, 01 Jan 2011) $6 !< $Author: m maipsl$7 !< $Revision: 45 $5 !< $Date: 2011-06-21 15:28:18 +0200 (Tue, 21 Jun 2011) $ 6 !< $Author: martial.mancip $ 7 !< $Revision: 275 $ 8 8 !! IPSL (2006) 9 9 !! This software is governed by the CeCILL licence see ORCHIDEE/ORCHIDEE_CeCILL.LIC … … 78 78 lai, height, veget, frac_nobio, veget_max, totfrac_nobio, qsintmax, & 79 79 rest_id, hist_id, hist2_id, rest_id_stom, hist_id_stom, hist_id_stom_IPCC, & 80 co2_flux )80 co2_flux, fco2_lu) 81 81 82 82 … … 117 117 ! output fields 118 118 REAL(r_std), DIMENSION (kjpindex,nvm), INTENT(out) :: co2_flux !! CO2 flux in gC/m**2 of average ground/second 119 REAL(r_std),DIMENSION (kjpindex), INTENT (out) :: fco2_lu !! Land Cover Change CO2 flux (gC/m**2 of average ground/s) 119 120 ! modified scalar 120 121 ! modified fields … … 190 191 veget_nextyear, totfrac_nobio_nextyear, & 191 192 hist_id, hist2_id, rest_id_stom, hist_id_stom, hist_id_stom_IPCC, & 192 co2_flux, resp_maint,resp_hetero,resp_growth)193 co2_flux, fco2_lu, resp_maint,resp_hetero,resp_growth) 193 194 ! 194 195 ENDIF … … 286 287 veget_nextyear, totfrac_nobio_nextyear, & 287 288 hist_id, hist2_id, rest_id_stom, hist_id_stom, hist_id_stom_IPCC, & 288 co2_flux, resp_maint,resp_hetero,resp_growth)289 co2_flux, fco2_lu, resp_maint,resp_hetero,resp_growth) 289 290 ENDIF 290 291 … … 384 385 veget_nextyear, totfrac_nobio_nextyear, & 385 386 hist_id, hist2_id, rest_id_stom, hist_id_stom, hist_id_stom_IPCC, & 386 co2_flux, resp_maint,resp_hetero,resp_growth)387 co2_flux, fco2_lu, resp_maint,resp_hetero,resp_growth) 387 388 IF ( control%ok_stomate .AND. control%ok_sechiba ) THEN 388 389 CALL histwrite(hist_id, 'maint_resp', kjit, resp_maint, kjpindex*nvm, indexveg) … … 756 757 CALL getin_p ("HYDROL_SOIL_DEPTH", dpu_cste) 757 758 dpu(:)=dpu_cste 758 !759 !Config Key = HYDROL_HUMCSTE760 !Config Desc = Root profile761 !Config Def = 5., .8, .8, 1., .8, .8, 1., 1., .8, 4., 4., 4., 4.762 !Config Help = Default values were defined for 2 meters soil depth.763 !Config For 4 meters soil depth, you may use those ones :764 !Config 5., .4, .4, 1., .8, .8, 1., 1., .8, 4., 1., 4., 1.765 !766 ! humcste(:)= &767 ! & (/5., .8, .8, 1., .8, .8, 1., 1., .8, 4., 4., 4., 4./)768 !!$ CALL getin_p ("HYDROL_HUMCSTE", humcste)769 770 759 !MM, T. d'O. : before in constantes_soil : 771 760 ! diaglev = & … … 2917 2906 ! 2918 2907 IF (MAXVAL(vegmap) .LT. nolson) THEN 2919 WRITE(*,*) 'WARNING -- WARNING'2920 WRITE(*,*) 'The vegetation map has to few vegetation types.'2921 WRITE(*,*) 'If you are lucky it will work but please check'2908 WRITE(*,*) 'WARNING -- WARNING' 2909 WRITE(*,*) 'The vegetation map has to few vegetation types.' 2910 WRITE(*,*) 'If you are lucky it will work but please check' 2922 2911 ELSE IF ( MAXVAL(vegmap) .GT. nolson) THEN 2923 WRITE(*,*) 'More vegetation types in file than the code can'2924 WRITE(*,*) 'deal with.: ', MAXVAL(vegmap), nolson2925 STOP 'slowproc_interpol'2912 WRITE(*,*) 'More vegetation types in file than the code can' 2913 WRITE(*,*) 'deal with.: ', MAXVAL(vegmap), nolson 2914 STOP 'slowproc_interpol' 2926 2915 ENDIF 2927 2916 ! -
branches/ORCHIDEE_EXT/ORCHIDEE/src_stomate/stomate.f90
r257 r277 328 328 & veget_max_new, totfrac_nobio_new, & 329 329 & hist_id, hist2_id, rest_id_stom, hist_id_stom, hist_id_stom_IPCC, & 330 & co2_flux, resp_maint,resp_hetero,resp_growth)330 & co2_flux, fco2_lu, resp_maint,resp_hetero,resp_growth) 331 331 !--------------------------------------------------------------------- 332 332 ! … … 418 418 !NV champs 2D 419 419 REAL(r_std),DIMENSION(kjpindex,nvm),INTENT(out) :: co2_flux 420 REAL(r_std),DIMENSION(kjpindex),INTENT(out) :: fco2_lu 420 421 ! autotrophic respiration in gC/m**2 of surface/dt 421 422 REAL(r_std),DIMENSION(kjpindex,nvm),INTENT(out) :: resp_maint … … 598 599 ! 599 600 ! 1.3.1 read STOMATE's start file 601 ! 602 co2_flux(:,:) = zero 603 fco2_lu(:) = zero 600 604 ! 601 605 CALL readstart & … … 1337 1341 & fpc_max) 1338 1342 1343 ! 1344 ! fco2_lu --> luccarb 1345 fco2_lu(:) = convflux(:) & 1346 & + cflux_prod10(:) & 1347 & + cflux_prod100(:) & 1348 & + harvest_above(:) 1339 1349 ! 1340 1350 ! 6.4 output: transform from dimension nvm to dimension nvm
Note: See TracChangeset
for help on using the changeset viewer.