Changeset 1378 for IOIPSL/trunk/src/histcom.f90
- Timestamp:
- 04/20/11 12:08:00 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
IOIPSL/trunk/src/histcom.f90
r1028 r1378 12 12 USE fliocom, ONLY : flio_dom_file,flio_dom_att 13 13 USE calendar 14 USE errioipsl, ONLY : ipslerr,ipsldbg 14 USE errioipsl, ONLY : ipslerr,ipsldbg,ipslout 15 15 !- 16 16 IMPLICIT NONE … … 340 340 ENDIF 341 341 !- 342 IF (l_dbg) WRITE( *,*) c_nam//" 0.0"342 IF (l_dbg) WRITE(ipslout,*) c_nam//" 0.0" 343 343 !- 344 344 ! Search for a free index … … 358 358 ! 1.0 Transfering into the common for future use 359 359 !- 360 IF (l_dbg) WRITE( *,*) c_nam//" 1.0"360 IF (l_dbg) WRITE(ipslout,*) c_nam//" 1.0" 361 361 !- 362 362 W_F(idf)%itau0 = pitau0 … … 366 366 ! 2.0 Initializes all variables for this file 367 367 !- 368 IF (l_dbg) WRITE( *,*) c_nam//" 2.0"368 IF (l_dbg) WRITE(ipslout,*) c_nam//" 2.0" 369 369 !- 370 370 W_F(idf)%n_var = 0 … … 383 383 ! 3.0 Opening netcdf file and defining dimensions 384 384 !- 385 IF (l_dbg) WRITE( *,*) c_nam//" 3.0"385 IF (l_dbg) WRITE(ipslout,*) c_nam//" 3.0" 386 386 !- 387 387 ! Add DOMAIN number and ".nc" suffix in file name if needed … … 425 425 ! 4.0 Declaring the geographical coordinates and other attributes 426 426 !- 427 IF (l_dbg) WRITE( *,*) c_nam//" 4.0"427 IF (l_dbg) WRITE(ipslout,*) c_nam//" 4.0" 428 428 !- 429 429 iret = NF90_PUT_ATT(nfid,NF90_GLOBAL,'Conventions','CF-1.1') … … 436 436 ! 5.0 Saving some important information on this file in the common 437 437 !- 438 IF (l_dbg) WRITE( *,*) c_nam//" 5.0"438 IF (l_dbg) WRITE(ipslout,*) c_nam//" 5.0" 439 439 !- 440 440 IF (PRESENT(domain_id)) THEN … … 612 612 ! 1.1 Create all the variables needed 613 613 !- 614 IF (l_dbg) WRITE( *,*) c_nam//" 1.0"614 IF (l_dbg) WRITE(ipslout,*) c_nam//" 1.0" 615 615 !- 616 616 nfid = W_F(idf)%ncfid … … 671 671 ! 2.0 Longitude 672 672 !- 673 IF (l_dbg) WRITE( *,*) c_nam//" 2.0"673 IF (l_dbg) WRITE(ipslout,*) c_nam//" 2.0" 674 674 !- 675 675 i_s = 1; … … 702 702 ! 3.0 Latitude 703 703 !- 704 IF (l_dbg) WRITE( *,*) c_nam//" 3.0"704 IF (l_dbg) WRITE(ipslout,*) c_nam//" 3.0" 705 705 !- 706 706 i_e = 2; … … 736 736 ! 4.0 storing the geographical coordinates 737 737 !- 738 IF (l_dbg) WRITE( *,*) c_nam//" 4.0"738 IF (l_dbg) WRITE(ipslout,*) c_nam//" 4.0" 739 739 !- 740 740 IF ( (k_typ == 1).OR.(k_typ == 2) ) THEN … … 833 833 ! Is the name already in use ? 834 834 !- 835 IF (l_dbg) WRITE( *,*) "histvert : 1.0 Verifications", &835 IF (l_dbg) WRITE(ipslout,*) "histvert : 1.0 Verifications", & 836 836 & pzaxname,'---',pzaxunit,'---',pzaxtitle 837 837 !- … … 883 883 !- 884 884 IF (l_dbg) & 885 & WRITE( *,*) "histvert : 2.0 Add the information to the file"885 & WRITE(ipslout,*) "histvert : 2.0 Add the information to the file" 886 886 !- 887 887 nfid = W_F(idf)%ncfid … … 918 918 !- 919 919 IF (l_dbg) & 920 & WRITE( *,*) "histvert : 3.0 add the information to the common"920 & WRITE(ipslout,*) "histvert : 3.0 add the information to the common" 921 921 !- 922 922 W_F(idf)%n_zax = iv … … 1016 1016 ! and verify that it does not already exist 1017 1017 !- 1018 IF (l_dbg) WRITE( *,*) "histdef : 1.0"1018 IF (l_dbg) WRITE(ipslout,*) "histdef : 1.0" 1019 1019 !- 1020 1020 IF (iv > 1) THEN … … 1070 1070 !- 1071 1071 IF (l_dbg) THEN 1072 WRITE( *,*) "histdef : 2.0",idf,iv,W_F(idf)%W_V(iv)%nbopp, &1072 WRITE(ipslout,*) "histdef : 2.0",idf,iv,W_F(idf)%W_V(iv)%nbopp, & 1073 1073 & W_F(idf)%W_V(iv)%sopp(1:W_F(idf)%W_V(iv)%nbopp), & 1074 1074 & W_F(idf)%W_V(iv)%scal(1:W_F(idf)%W_V(iv)%nbopp) … … 1164 1164 !- 1165 1165 IF (l_dbg) THEN 1166 WRITE( *,*) "histdef : 3.0"1166 WRITE(ipslout,*) "histdef : 3.0" 1167 1167 ENDIF 1168 1168 !- … … 1177 1177 W_F(idf)%W_V(iv)%t_bf(:) = 0. 1178 1178 IF (l_dbg) THEN 1179 WRITE( *,*) "histdef : 3.0 allocating time_buffer for", &1179 WRITE(ipslout,*) "histdef : 3.0 allocating time_buffer for", & 1180 1180 & " idf = ",idf," iv = ",iv," size = ",buff_sz 1181 1181 ENDIF … … 1187 1187 ! The strategy is to bring it back to seconds for the tests 1188 1188 !- 1189 IF (l_dbg) WRITE( *,*) "histdef : 4.0"1189 IF (l_dbg) WRITE(ipslout,*) "histdef : 4.0" 1190 1190 !- 1191 1191 W_F(idf)%W_V(iv)%freq_opp = pfreq_opp … … 1272 1272 ! 5.0 Initialize other variables of the common 1273 1273 !- 1274 IF (l_dbg) WRITE( *,*) "histdef : 5.0"1274 IF (l_dbg) WRITE(ipslout,*) "histdef : 5.0" 1275 1275 !- 1276 1276 W_F(idf)%W_V(iv)%hist_wrt_rng = (PRESENT(var_range)) … … 1298 1298 ! 6.0 Get the time axis for this variable 1299 1299 !- 1300 IF (l_dbg) WRITE( *,*) "histdef : 6.0"1300 IF (l_dbg) WRITE(ipslout,*) "histdef : 6.0" 1301 1301 !- 1302 1302 ! No time axis for once, l_max, l_min or never operation … … 1331 1331 ELSE 1332 1332 IF (l_dbg) THEN 1333 WRITE( *,*) "histdef : 7.0 ",TRIM(W_F(idf)%W_V(iv)%topp),'----'1333 WRITE(ipslout,*) "histdef : 7.0 ",TRIM(W_F(idf)%W_V(iv)%topp),'----' 1334 1334 ENDIF 1335 1335 W_F(idf)%W_V(iv)%t_axid = -99 … … 1385 1385 ! 1.0 Create the time axes 1386 1386 !- 1387 IF (l_dbg) WRITE( *,*) "histend : 1.0"1387 IF (l_dbg) WRITE(ipslout,*) "histend : 1.0" 1388 1388 !- 1389 1389 ! 1.1 Define the time dimensions needed for this file … … 1473 1473 ! 2.0 declare the variables 1474 1474 !- 1475 IF (l_dbg) WRITE( *,*) "histend : 2.0"1475 IF (l_dbg) WRITE(ipslout,*) "histend : 2.0" 1476 1476 !- 1477 1477 DO iv=1,W_F(idf)%n_var … … 1575 1575 !- 1576 1576 IF (l_dbg) THEN 1577 WRITE( *,*) "histend : 2.0.n, freq_opp, freq_wrt", &1577 WRITE(ipslout,*) "histend : 2.0.n, freq_opp, freq_wrt", & 1578 1578 & W_F(idf)%W_V(iv)%freq_opp,W_F(idf)%W_V(iv)%freq_wrt 1579 1579 ENDIF … … 1596 1596 ! 3.0 Put the netcdf file into write mode 1597 1597 !- 1598 IF (l_dbg) WRITE( *,*) "histend : 3.0"1598 IF (l_dbg) WRITE(ipslout,*) "histend : 3.0" 1599 1599 !- 1600 1600 iret = NF90_ENDDEF (nfid) … … 1602 1602 ! 4.0 Give some informations to the user 1603 1603 !- 1604 IF (l_dbg) WRITE( *,*) "histend : 4.0"1604 IF (l_dbg) WRITE(ipslout,*) "histend : 4.0" 1605 1605 !- 1606 1606 WRITE(str70,'("All variables have been initialized on file :",I3)') idf … … 1682 1682 !- 1683 1683 IF (l_dbg) THEN 1684 WRITE( *,*) "histwrite : ",c_nam1684 WRITE(ipslout,*) "histwrite : ",c_nam 1685 1685 ENDIF 1686 1686 !- … … 1791 1791 IF (.NOT.ALLOCATED(tbf_1)) THEN 1792 1792 IF (l_dbg) THEN 1793 WRITE( *,*) &1793 WRITE(ipslout,*) & 1794 1794 & c_nam//" : allocate tbf_1 for size = ", & 1795 1795 & W_F(idf)%W_V(iv)%datasz_max … … 1798 1798 ELSE IF (W_F(idf)%W_V(iv)%datasz_max > SIZE(tbf_1)) THEN 1799 1799 IF (l_dbg) THEN 1800 WRITE( *,*) &1800 WRITE(ipslout,*) & 1801 1801 & c_nam//" : re-allocate tbf_1 for size = ", & 1802 1802 & W_F(idf)%W_V(iv)%datasz_max … … 1871 1871 !- 1872 1872 IF (l_dbg) THEN 1873 WRITE( *,*) "histwrite 0.0 : VAR : ",W_F(idf)%W_V(iv)%v_name1874 WRITE( *,*) "histwrite 0.0 : nbindex :",nbindex1875 WRITE( *,*) "histwrite 0.0 : nindex :",nindex(1:MIN(3,nbindex)),'...'1873 WRITE(ipslout,*) "histwrite 0.0 : VAR : ",W_F(idf)%W_V(iv)%v_name 1874 WRITE(ipslout,*) "histwrite 0.0 : nbindex :",nbindex 1875 WRITE(ipslout,*) "histwrite 0.0 : nindex :",nindex(1:MIN(3,nbindex)),'...' 1876 1876 ENDIF 1877 1877 !- … … 1888 1888 IF (.NOT.ALLOCATED(tbf_2)) THEN 1889 1889 IF (l_dbg) THEN 1890 WRITE( *,*) "histwrite_real 1.1 allocate tbf_2 ",SIZE(tbf_1)1890 WRITE(ipslout,*) "histwrite_real 1.1 allocate tbf_2 ",SIZE(tbf_1) 1891 1891 ENDIF 1892 1892 ALLOCATE(tbf_2(W_F(idf)%W_V(iv)%datasz_max)) 1893 1893 ELSE IF (W_F(idf)%W_V(iv)%datasz_max > SIZE(tbf_2)) THEN 1894 1894 IF (l_dbg) THEN 1895 WRITE( *,*) "histwrite_real 1.2 re-allocate tbf_2 : ", &1895 WRITE(ipslout,*) "histwrite_real 1.2 re-allocate tbf_2 : ", & 1896 1896 & SIZE(tbf_1)," instead of ",SIZE(tbf_2) 1897 1897 ENDIF … … 1906 1906 !- 1907 1907 IF (l_dbg) THEN 1908 WRITE( *,*) "histwrite: 3.0",idf1908 WRITE(ipslout,*) "histwrite: 3.0",idf 1909 1909 ENDIF 1910 1910 !- … … 1924 1924 & nbout,tbf_2) 1925 1925 IF (l_dbg) THEN 1926 WRITE( *,*) &1926 WRITE(ipslout,*) & 1927 1927 & "histwrite: 3.4a nbout : ",nbin,nbout,W_F(idf)%W_V(iv)%sopp(io) 1928 1928 ENDIF … … 1934 1934 & nbout,tbf_1) 1935 1935 IF (l_dbg) THEN 1936 WRITE( *,*) &1936 WRITE(ipslout,*) & 1937 1937 & "histwrite: 3.4b nbout : ",nbin,nbout,W_F(idf)%W_V(iv)%sopp(io+1) 1938 1938 ENDIF … … 1942 1942 !- 1943 1943 IF (l_dbg) THEN 1944 WRITE( *,*) &1944 WRITE(ipslout,*) & 1945 1945 & "histwrite: 3.5 size(tbf_1) : ",SIZE(tbf_1) 1946 WRITE( *,*) &1946 WRITE(ipslout,*) & 1947 1947 & "histwrite: 3.5 slab in X :", & 1948 1948 & W_F(idf)%W_V(iv)%zorig(1),W_F(idf)%W_V(iv)%zsize(1) 1949 WRITE( *,*) &1949 WRITE(ipslout,*) & 1950 1950 & "histwrite: 3.5 slab in Y :", & 1951 1951 & W_F(idf)%W_V(iv)%zorig(2),W_F(idf)%W_V(iv)%zsize(2) 1952 WRITE( *,*) &1952 WRITE(ipslout,*) & 1953 1953 & "histwrite: 3.5 slab in Z :", & 1954 1954 & W_F(idf)%W_V(iv)%zorig(3),W_F(idf)%W_V(iv)%zsize(3) 1955 WRITE( *,*) &1955 WRITE(ipslout,*) & 1956 1956 & "histwrite: 3.5 slab of input:", & 1957 1957 & W_F(idf)%W_V(iv)%scsize(1), & … … 1999 1999 !- 2000 2000 IF (l_dbg) THEN 2001 WRITE( *,*) "histwrite: 4.0 tbf_1",idf,iv, &2001 WRITE(ipslout,*) "histwrite: 4.0 tbf_1",idf,iv, & 2002 2002 & TRIM(tmp_opp),' ---- ',LEN_TRIM(tmp_opp),nbindex 2003 2003 ENDIF … … 2016 2016 !- 2017 2017 IF (l_dbg) THEN 2018 WRITE( *,*) "histwrite: 5.0 idf : ",idf," iv : ",iv," tsz : ",tsz2018 WRITE(ipslout,*) "histwrite: 5.0 idf : ",idf," iv : ",iv," tsz : ",tsz 2019 2019 ENDIF 2020 2020 !- … … 2032 2032 ! 6.0 Write to file if needed 2033 2033 !- 2034 IF (l_dbg) WRITE( *,*) "histwrite: 6.0",idf2034 IF (l_dbg) WRITE(ipslout,*) "histwrite: 6.0",idf 2035 2035 !- 2036 2036 IF (do_write) THEN … … 2041 2041 !-- 6.1 Do the operations that are needed before writting 2042 2042 !- 2043 IF (l_dbg) WRITE( *,*) "histwrite: 6.1",idf2043 IF (l_dbg) WRITE(ipslout,*) "histwrite: 6.1",idf 2044 2044 !- 2045 2045 IF ( (TRIM(tmp_opp) /= "inst") & … … 2055 2055 & .AND.(TRIM(tmp_opp) /= "once") ) THEN 2056 2056 !- 2057 IF (l_dbg) WRITE( *,*) "histwrite: 6.2",idf2057 IF (l_dbg) WRITE(ipslout,*) "histwrite: 6.2",idf 2058 2058 !- 2059 2059 itax = W_F(idf)%W_V(iv)%t_axid … … 2077 2077 !- 2078 2078 IF (l_dbg) THEN 2079 WRITE( *,*) "histwrite: 6.3",idf,nfid,nvid,iv,itime2079 WRITE(ipslout,*) "histwrite: 6.3",idf,nfid,nvid,iv,itime 2080 2080 ENDIF 2081 2081 !- … … 2159 2159 !- 2160 2160 IF (l_dbg) THEN 2161 WRITE( *,*) 'histvar_seq, start of the subroutine :',learning(idf)2161 WRITE(ipslout,*) 'histvar_seq, start of the subroutine :',learning(idf) 2162 2162 ENDIF 2163 2163 !- … … 2203 2203 & 'of your code. Thus if you wish to save time'// & 2204 2204 & ' contact the IOIPSL team. ') 2205 WRITE( *,*) 'The sequence we have found up to now :'2206 WRITE( *,*) varseq(idf,1:sp-1)2205 WRITE(ipslout,*) 'The sequence we have found up to now :' 2206 WRITE(ipslout,*) varseq(idf,1:sp-1) 2207 2207 varseq_err(idf) = -1 2208 2208 ENDIF … … 2268 2268 !- 2269 2269 IF (l_dbg) THEN 2270 WRITE( *,*) &2270 WRITE(ipslout,*) & 2271 2271 & 'histvar_seq, end of the subroutine :',TRIM(pvarname),idv 2272 2272 ENDIF … … 2294 2294 !- 2295 2295 IF (l_dbg) THEN 2296 WRITE( *,*) "->histsync"2296 WRITE(ipslout,*) "->histsync" 2297 2297 ENDIF 2298 2298 !- … … 2319 2319 IF (W_F(ifile)%ncfid > 0) THEN 2320 2320 IF (l_dbg) THEN 2321 WRITE( *,*) ' histsync - synchronising file number ',ifile2321 WRITE(ipslout,*) ' histsync - synchronising file number ',ifile 2322 2322 ENDIF 2323 2323 iret = NF90_SYNC(W_F(ifile)%ncfid) … … 2326 2326 !- 2327 2327 IF (l_dbg) THEN 2328 WRITE( *,*) "<-histsync"2328 WRITE(ipslout,*) "<-histsync" 2329 2329 ENDIF 2330 2330 !---------------------- … … 2349 2349 !- 2350 2350 IF (l_dbg) THEN 2351 WRITE( *,*) "->histclo"2351 WRITE(ipslout,*) "->histclo" 2352 2352 ENDIF 2353 2353 !- … … 2374 2374 IF (W_F(ifile)%ncfid > 0) THEN 2375 2375 IF (l_dbg) THEN 2376 WRITE( *,*) ' histclo - closing specified file number :',ifile2376 WRITE(ipslout,*) ' histclo - closing specified file number :',ifile 2377 2377 ENDIF 2378 2378 nfid = W_F(ifile)%ncfid … … 2382 2382 !----- 2383 2383 IF (l_dbg) THEN 2384 WRITE( *,*) ' Entering loop on vars : ',W_F(ifile)%n_var2384 WRITE(ipslout,*) ' Entering loop on vars : ',W_F(ifile)%n_var 2385 2385 ENDIF 2386 2386 DO iv=1,W_F(ifile)%n_var … … 2388 2388 IF (W_F(ifile)%W_V(iv)%hist_wrt_rng) THEN 2389 2389 IF (l_dbg) THEN 2390 WRITE( *,*) 'min value for file :',ifile,' var n. :',iv, &2390 WRITE(ipslout,*) 'min value for file :',ifile,' var n. :',iv, & 2391 2391 & ' is : ',W_F(ifile)%W_V(iv)%hist_minmax(1) 2392 WRITE( *,*) 'max value for file :',ifile,' var n. :',iv, &2392 WRITE(ipslout,*) 'max value for file :',ifile,' var n. :',iv, & 2393 2393 & ' is : ',W_F(ifile)%W_V(iv)%hist_minmax(2) 2394 2394 ENDIF … … 2420 2420 !---- 2. Close the file 2421 2421 !----- 2422 IF (l_dbg) WRITE( *,*) ' close file :',nfid2422 IF (l_dbg) WRITE(ipslout,*) ' close file :',nfid 2423 2423 iret = NF90_CLOSE(nfid) 2424 2424 W_F(ifile)%ncfid = -1 … … 2428 2428 !- 2429 2429 IF (l_dbg) THEN 2430 WRITE( *,*) "<-histclo"2430 WRITE(ipslout,*) "<-histclo" 2431 2431 ENDIF 2432 2432 !---------------------
Note: See TracChangeset
for help on using the changeset viewer.