Changeset 1637 for LMDZ5


Ignore:
Timestamp:
Jul 18, 2012, 5:35:21 PM (12 years ago)
Author:
lguez
Message:

Bug fix

File:
1 edited

Legend:

Unmodified
Added
Removed
  • LMDZ5/trunk/libf/bibio/nf95_gw_var_m.F90

    r1635 r1637  
    200200  !************************************
    201201
    202   subroutine nf95_gw_var_dble_1d(ncid, varid, values)
    203 
    204     ! Double precision, the array has rank 1.
    205 
    206     integer, intent(in):: ncid
    207     integer, intent(in):: varid
    208     double precision, pointer:: values(:)
     202!!$  subroutine nf95_gw_var_dble_1d(ncid, varid, values)
     203!!$
     204!!$    ! Double precision, the array has rank 1.
     205!!$
     206!!$    integer, intent(in):: ncid
     207!!$    integer, intent(in):: varid
     208!!$    double precision, pointer:: values(:)
     209!!$
     210!!$    ! Variables local to the procedure:
     211!!$    integer nclen
     212!!$    integer, pointer:: dimids(:)
     213!!$
     214!!$    !---------------------
     215!!$
     216!!$    call nf95_inquire_variable(ncid, varid, dimids=dimids)
     217!!$
     218!!$    if (size(dimids) /= 1) then
     219!!$       print *, "nf95_gw_var_dble_1d:"
     220!!$       print *, "varid = ", varid
     221!!$       print *, "rank of NetCDF variable is ", size(dimids), ", not 1"
     222!!$        stop 1
     223!!$    end if
     224!!$
     225!!$    call nf95_inquire_dimension(ncid, dimids(1), nclen=nclen)
     226!!$    deallocate(dimids) ! pointer
     227!!$
     228!!$    allocate(values(nclen))
     229!!$    if (nclen /= 0) call NF95_GET_VAR(ncid, varid, values)
     230!!$
     231!!$  end subroutine nf95_gw_var_dble_1d
     232!!$
     233!!$  !************************************
     234!!$
     235!!$  subroutine nf95_gw_var_dble_3d(ncid, varid, values)
     236!!$
     237!!$    ! Double precision, the array has rank 3.
     238!!$
     239!!$    integer, intent(in):: ncid
     240!!$    integer, intent(in):: varid
     241!!$    double precision, pointer:: values(:, :, :)
     242!!$
     243!!$    ! Variables local to the procedure:
     244!!$    integer nclen1, nclen2, nclen3
     245!!$    integer, pointer:: dimids(:)
     246!!$
     247!!$    !---------------------
     248!!$
     249!!$    call nf95_inquire_variable(ncid, varid, dimids=dimids)
     250!!$
     251!!$    if (size(dimids) /= 3) then
     252!!$       print *, "nf95_gw_var_dble_3d:"
     253!!$       print *, "varid = ", varid
     254!!$       print *, "rank of NetCDF variable is ", size(dimids), ", not 3"
     255!!$       stop 1
     256!!$    end if
     257!!$
     258!!$    call nf95_inquire_dimension(ncid, dimids(1), nclen=nclen1)
     259!!$    call nf95_inquire_dimension(ncid, dimids(2), nclen=nclen2)
     260!!$    call nf95_inquire_dimension(ncid, dimids(3), nclen=nclen3)
     261!!$    deallocate(dimids) ! pointer
     262!!$
     263!!$    allocate(values(nclen1, nclen2, nclen3))
     264!!$    if (nclen1 * nclen2 * nclen3 /= 0) call NF95_GET_VAR(ncid, varid, values)
     265!!$
     266!!$  end subroutine nf95_gw_var_dble_3d
     267!!$
     268  !************************************
     269
     270  subroutine nf95_gw_var_int_1d(ncid, varid, values)
     271
     272    ! Integer type, the array has rank 1.
     273
     274    integer, intent(in):: ncid
     275    integer, intent(in):: varid
     276    integer, pointer:: values(:)
    209277
    210278    ! Variables local to the procedure:
     
    217285
    218286    if (size(dimids) /= 1) then
    219        print *, "nf95_gw_var_dble_1d:"
     287       print *, "nf95_gw_var_int_1d:"
    220288       print *, "varid = ", varid
    221289       print *, "rank of NetCDF variable is ", size(dimids), ", not 1"
    222         stop 1
     290       stop 1
    223291    end if
    224292
     
    229297    if (nclen /= 0) call NF95_GET_VAR(ncid, varid, values)
    230298
    231   end subroutine nf95_gw_var_dble_1d
    232 
    233   !************************************
    234 
    235   subroutine nf95_gw_var_dble_3d(ncid, varid, values)
    236 
    237     ! Double precision, the array has rank 3.
    238 
    239     integer, intent(in):: ncid
    240     integer, intent(in):: varid
    241     double precision, pointer:: values(:, :, :)
     299  end subroutine nf95_gw_var_int_1d
     300
     301  !************************************
     302
     303  subroutine nf95_gw_var_int_3d(ncid, varid, values)
     304
     305    ! Integer type, the array has rank 3.
     306
     307    integer, intent(in):: ncid
     308    integer, intent(in):: varid
     309    integer, pointer:: values(:, :, :)
    242310
    243311    ! Variables local to the procedure:
     
    250318
    251319    if (size(dimids) /= 3) then
    252        print *, "nf95_gw_var_dble_3d:"
     320       print *, "nf95_gw_var_int_3d:"
    253321       print *, "varid = ", varid
    254322       print *, "rank of NetCDF variable is ", size(dimids), ", not 3"
     
    264332    if (nclen1 * nclen2 * nclen3 /= 0) call NF95_GET_VAR(ncid, varid, values)
    265333
    266   end subroutine nf95_gw_var_dble_3d
    267 
    268   !************************************
    269 
    270   subroutine nf95_gw_var_int_1d(ncid, varid, values)
    271 
    272     ! Integer type, the array has rank 1.
    273 
    274     integer, intent(in):: ncid
    275     integer, intent(in):: varid
    276     integer, pointer:: values(:)
    277 
    278     ! Variables local to the procedure:
    279     integer nclen
    280     integer, pointer:: dimids(:)
    281 
    282     !---------------------
    283 
    284     call nf95_inquire_variable(ncid, varid, dimids=dimids)
    285 
    286     if (size(dimids) /= 1) then
    287        print *, "nf95_gw_var_int_1d:"
    288        print *, "varid = ", varid
    289        print *, "rank of NetCDF variable is ", size(dimids), ", not 1"
    290        stop 1
    291     end if
    292 
    293     call nf95_inquire_dimension(ncid, dimids(1), nclen=nclen)
    294     deallocate(dimids) ! pointer
    295 
    296     allocate(values(nclen))
    297     if (nclen /= 0) call NF95_GET_VAR(ncid, varid, values)
    298 
    299   end subroutine nf95_gw_var_int_1d
    300 
    301   !************************************
    302 
    303   subroutine nf95_gw_var_int_3d(ncid, varid, values)
    304 
    305     ! Integer type, the array has rank 3.
    306 
    307     integer, intent(in):: ncid
    308     integer, intent(in):: varid
    309     integer, pointer:: values(:, :, :)
    310 
    311     ! Variables local to the procedure:
    312     integer nclen1, nclen2, nclen3
    313     integer, pointer:: dimids(:)
    314 
    315     !---------------------
    316 
    317     call nf95_inquire_variable(ncid, varid, dimids=dimids)
    318 
    319     if (size(dimids) /= 3) then
    320        print *, "nf95_gw_var_int_3d:"
    321        print *, "varid = ", varid
    322        print *, "rank of NetCDF variable is ", size(dimids), ", not 3"
    323        stop 1
    324     end if
    325 
    326     call nf95_inquire_dimension(ncid, dimids(1), nclen=nclen1)
    327     call nf95_inquire_dimension(ncid, dimids(2), nclen=nclen2)
    328     call nf95_inquire_dimension(ncid, dimids(3), nclen=nclen3)
    329     deallocate(dimids) ! pointer
    330 
    331     allocate(values(nclen1, nclen2, nclen3))
    332     if (nclen1 * nclen2 * nclen3 /= 0) call NF95_GET_VAR(ncid, varid, values)
    333 
    334334  end subroutine nf95_gw_var_int_3d
    335335
Note: See TracChangeset for help on using the changeset viewer.