Subversion Repositories lagranto.icon

Rev

Rev 3 | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 3 Rev 5
Line 214... Line 214...
214
         read(fid) tra
214
         read(fid) tra
215
 
215
 
216
c     Read IVE netcdf mode (mode=4)
216
c     Read IVE netcdf mode (mode=4)
217
      elseif (mode.eq.4) then
217
      elseif (mode.eq.4) then
218
 
218
 
219
         call input_getvars(fid,nvars,vars,ierr)
219
         call input_getvars(fid,vars,nvars,ierr)
220
 
220
 
221
         ierr = NF90_INQ_VARID(fid,'time',varid)
221
         ierr = NF90_INQ_VARID(fid,'time',varid)
222
         IF (ierr /= nf90_NoErr) PRINT *,NF90_STRERROR(ierr)
222
         IF (ierr /= nf90_NoErr) PRINT *,NF90_STRERROR(ierr)
223
         
223
         
224
         ierr = nf90_get_var(fid, varid, tra(1,:,1)  )
224
         ierr = nf90_get_var(fid, varid, tra(1,:,1)  )
Line 240... Line 240...
240
         enddo
240
         enddo
241
 
241
 
242
c     Read COSMO online netcdf mode (mode=5)
242
c     Read COSMO online netcdf mode (mode=5)
243
      elseif (mode.eq.5) then
243
      elseif (mode.eq.5) then
244
 
244
 
245
         call input_getvars(fid,nvars,vars,ierr)
245
         call input_getvars(fid,vars,nvars,ierr)
246
 
246
 
247
         ierr = NF90_INQ_VARID(fid,'time',varid)
247
         ierr = NF90_INQ_VARID(fid,'time',varid)
248
         IF (ierr /= nf90_NoErr) PRINT *,NF90_STRERROR(ierr)
248
         IF (ierr /= nf90_NoErr) PRINT *,NF90_STRERROR(ierr)
249
         
249
         
250
         ierr = nf90_get_var(fid, varid, tra(1,:,1)  )
250
         ierr = nf90_get_var(fid, varid, tra(1,:,1)  )
Line 359... Line 359...
359
         write(fid) tra                              
359
         write(fid) tra                              
360
 
360
 
361
c     Write netcdf mode (mode=4)
361
c     Write netcdf mode (mode=4)
362
      elseif (mode.eq.4) then
362
      elseif (mode.eq.4) then
363
 
363
      
364
         call input_getvars(fid,nvars,vars,ierr)
364
         call input_getvars(fid,vars,nvars,ierr)
365
 
365
 
366
         ierr = NF90_INQ_VARID(fid,'time',varid)
366
         ierr = NF90_INQ_VARID(fid,'time',varid)
367
         IF (ierr /= nf90_NoErr) PRINT *,NF90_STRERROR(ierr)
367
         IF (ierr /= nf90_NoErr) PRINT *,NF90_STRERROR(ierr)
368
         
368
         
369
         ierr = nf90_put_var(fid, varid, tra(1,:,1)  )
369
         ierr = nf90_put_var(fid, varid, tra(1,:,1)  )
Line 531... Line 531...
531
         ierr  = nf90_get_att(fid,nf90_global,"ref_min",   time(5) )
531
         ierr  = nf90_get_att(fid,nf90_global,"ref_min",   time(5) )
532
         IF(ierr /= nf90_NoErr) PRINT *,NF90_STRERROR(ierr)
532
         IF(ierr /= nf90_NoErr) PRINT *,NF90_STRERROR(ierr)
533
         ierr  = nf90_get_att(fid,nf90_global,"duration",  time(6) )
533
         ierr  = nf90_get_att(fid,nf90_global,"duration",  time(6) )
534
         IF(ierr /= nf90_NoErr) PRINT *,NF90_STRERROR(ierr)
534
         IF(ierr /= nf90_NoErr) PRINT *,NF90_STRERROR(ierr)
535
 
535
 
536
         call  input_getvars(fid,ncol,vars,ierr)
536
         call  input_getvars(fid,vars,nvars,ierr)
537
 
537
 
538
c     Read COSMO online netcdf mode (mode=5)
538
c     Read COSMO online netcdf mode (mode=5)
539
      elseif (mode.eq.5) then
539
      elseif (mode.eq.5) then
540
 
540
 
541
         ierr  = nf90_get_att(fid,nf90_global,"ref_year",  time(1) )
541
         ierr  = nf90_get_att(fid,nf90_global,"ref_year",  time(1) )
Line 549... Line 549...
549
         ierr  = nf90_get_att(fid,nf90_global,"ref_min",   time(5) )
549
         ierr  = nf90_get_att(fid,nf90_global,"ref_min",   time(5) )
550
         IF(ierr /= nf90_NoErr) PRINT *,NF90_STRERROR(ierr)
550
         IF(ierr /= nf90_NoErr) PRINT *,NF90_STRERROR(ierr)
551
         ierr  = nf90_get_att(fid,nf90_global,"duration",  time(6) )
551
         ierr  = nf90_get_att(fid,nf90_global,"duration",  time(6) )
552
         IF(ierr /= nf90_NoErr) PRINT *,NF90_STRERROR(ierr)
552
         IF(ierr /= nf90_NoErr) PRINT *,NF90_STRERROR(ierr)
553
 
553
 
554
         call  input_getvars(fid,ncol,vars,ierr)
554
         call  input_getvars(fid,vars,nvars,ierr)
555
 
555
 
556
         if ( vars(2).eq.'longitude' ) then
556
         if ( vars(2).eq.'longitude' ) then
557
            vars(2) = 'lon'
557
            vars(2) = 'lon'
558
         else
558
         else
559
            print*,' ERROR: lon missing on netCDF file'
559
            print*,' ERROR: lon missing on netCDF file'
Line 703... Line 703...
703
            IF(ierr /= nf90_NoErr) PRINT *,NF90_STRERROR(ierr)
703
            IF(ierr /= nf90_NoErr) PRINT *,NF90_STRERROR(ierr)
704
         enddo
704
         enddo
705
 
705
 
706
         ierr = nf90_enddef(fid)
706
         ierr = nf90_enddef(fid)
707
         IF(ierr /= nf90_NoErr) PRINT *,NF90_STRERROR(ierr)
707
         IF(ierr /= nf90_NoErr) PRINT *,NF90_STRERROR(ierr)
708
 
-
 
-
 
708
         print*,1
709
         call input_getvars(fid,nvars,vars_on_file,ierr)
709
         call input_getvars(fid,vars_on_file,nvars,ierr)
-
 
710
         print*,2,nvars
710
         if ( nvars.ne.ncol ) then
711
         if ( nvars.ne.ncol ) then
711
            print*,' ERROR: wrong number of fields on netCDF....'
712
            print*,' ERROR: wrong number of fields on netCDF....'
712
            stop
713
            stop
713
         endif
714
         endif
714
         do i=1,nvars
715
         do i=1,nvars
Line 936... Line 937...
936
      elseif (mode.eq.3) then
937
      elseif (mode.eq.3) then
937
         read(fid) ntra,ntim,ncol
938
         read(fid) ntra,ntim,ncol
938
 
939
 
939
      elseif (mode.eq.4) then
940
      elseif (mode.eq.4) then
940
              
941
              
941
         call input_getvars(fid,ncol,vars,ierr)
942
         call input_getvars(fid,vars,ncol,ierr)
942
 
943
 
943
         ierr = nf90_inq_dimid(fid,'ntra', ntraID)
944
         ierr = nf90_inq_dimid(fid,'ntra', ntraID)
944
         IF(ierr /= nf90_NoErr) PRINT *,NF90_STRERROR(ierr)
945
         IF(ierr /= nf90_NoErr) PRINT *,NF90_STRERROR(ierr)
945
         ierr = nf90_inquire_dimension(fid, ntraID, len = ntra)
946
         ierr = nf90_inquire_dimension(fid, ntraID, len = ntra)
946
         IF(ierr /= nf90_NoErr) PRINT *,NF90_STRERROR(ierr)
947
         IF(ierr /= nf90_NoErr) PRINT *,NF90_STRERROR(ierr)
Line 950... Line 951...
950
         ierr = nf90_inquire_dimension(fid, ntimID, len = ntim)
951
         ierr = nf90_inquire_dimension(fid, ntimID, len = ntim)
951
         IF(ierr /= nf90_NoErr) PRINT *,NF90_STRERROR(ierr)
952
         IF(ierr /= nf90_NoErr) PRINT *,NF90_STRERROR(ierr)
952
 
953
 
953
      elseif (mode.eq.5) then
954
      elseif (mode.eq.5) then
954
 
955
 
955
         call input_getvars(fid,ncol,vars,ierr)
956
         call input_getvars(fid,vars,ncol,ierr)
956
 
957
 
957
         ierr = nf90_inq_dimid(fid,'id', ntraID)
958
         ierr = nf90_inq_dimid(fid,'id', ntraID)
958
         IF(ierr /= nf90_NoErr) PRINT *,NF90_STRERROR(ierr)
959
         IF(ierr /= nf90_NoErr) PRINT *,NF90_STRERROR(ierr)
959
         ierr = nf90_inquire_dimension(fid, ntraID, len = ntra)
960
         ierr = nf90_inquire_dimension(fid, ntraID, len = ntra)
960
         IF(ierr /= nf90_NoErr) PRINT *,NF90_STRERROR(ierr)
961
         IF(ierr /= nf90_NoErr) PRINT *,NF90_STRERROR(ierr)