Changeset 632 for trunk/LMDZ.MARS/util/concatnc.F90
- Timestamp:
- Apr 25, 2012, 10:23:52 AM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LMDZ.MARS/util/concatnc.F90
r410 r632 713 713 !============================================================================== 714 714 ! Purpose: 715 ! Copy ap() , bp(), aps(), bps() and phisinit() from input file to outpout file 715 ! Copy ap() , bp(), aps(), bps(), aire() and phisinit() 716 ! from input file to outpout file 716 717 !============================================================================== 717 718 ! Remarks: … … 743 744 real,dimension(:),allocatable :: ap,bp ! hybrid vertical coordinates 744 745 real,dimension(:),allocatable :: sigma ! sigma levels 746 real,dimension(:,:),allocatable :: aire ! mesh areas 745 747 real,dimension(:,:),allocatable :: phisinit ! Ground geopotential 746 748 integer :: apsid,bpsid,sigmaid,phisinitid … … 748 750 integer :: ierr 749 751 integer :: tmpvarid ! temporary variable ID 752 logical :: area ! is "aire" available ? 750 753 logical :: phis ! is "phisinit" available ? 751 754 logical :: hybrid ! are "aps" and "bps" available ? … … 843 846 endif ! of if (.not.hybrid) 844 847 848 ! mesh area 849 allocate(aire(lonlen,latlen),stat=ierr) 850 if (ierr.ne.0) then 851 write(*,*) "init2: failed to allocate aire!" 852 stop 853 endif 854 ierr=NF_INQ_VARID(infid,"aire",tmpvarid) 855 if (ierr.ne.NF_NOERR) then 856 write(*,*)"init2 warning: Failed to get aire ID." 857 area = .false. 858 else 859 ierr=NF_GET_VAR_REAL(infid,tmpvarid,aire) 860 if (ierr.ne.NF_NOERR) then 861 stop "init2 Error: Failed reading aire" 862 endif 863 area = .true. 864 endif 865 845 866 ! ground geopotential phisinit 846 867 allocate(phisinit(lonlen,latlen),stat=ierr) … … 958 979 959 980 !============================================================================== 960 ! 2.2. phisinit() 961 !============================================================================== 981 ! 2.2. aire() and phisinit() 982 !============================================================================== 983 984 if (area) then 985 ! define aire 986 call def_var(nout,"aire","Mesh area","m2",2,& 987 (/londimout,latdimout/),tmpvarid,ierr) 988 if (ierr.ne.NF_NOERR) then 989 stop "init2 Error: Failed to def_var aire" 990 endif 991 992 ! write aire 993 #ifdef NC_DOUBLE 994 ierr=NF_PUT_VAR_DOUBLE(outfid,tmpvarid,aire) 995 #else 996 ierr=NF_PUT_VAR_REAL(outfid,tmpvarid,aire) 997 #endif 998 if (ierr.ne.NF_NOERR) then 999 stop "init2 Error: Failed to write aire" 1000 endif 1001 endif ! of if (area) 962 1002 963 1003 IF (phis) THEN … … 990 1030 if (allocated(sigma)) deallocate(sigma) 991 1031 if (allocated(phisinit)) deallocate(phisinit) 1032 if (allocated(aire)) deallocate(aire) 992 1033 993 1034 end subroutine init2
Note: See TracChangeset
for help on using the changeset viewer.