psmile_store_data_reducedgrid.F90

Go to the documentation of this file.
00001 !-----------------------------------------------------------------------
00002 ! Copyright 2010, DKRZ, Hamburg, Germany.
00003 ! All rights reserved. Use is subject to OASIS4 license terms.
00004 !-----------------------------------------------------------------------
00005 !
00006 ! !DESCRIPTION:
00007 !
00008 ! The routine psmile_store_data_reducedgrid stores the data provided
00009 ! by the user through the interface prism_reducedgrid_map.
00010 !
00011 !
00012 ! !REVISION HISTORY:
00013 !
00014 !   Date      Programmer   Description
00015 ! ----------  ----------   -----------
00016 ! 27.10.10    M. Hanke     created
00017 !
00018 !----------------------------------------------------------------------
00019 !
00020 !  $Id: psmile_store_data_reducedgrid.F90 2743 2010-11-18 10:54:43Z hanke $
00021 !  $Author: hanke $
00022 !
00023 !----------------------------------------------------------------------
00024 
00025 subroutine psmile_store_data_reducedgrid (grid_id, nbr_latitudes, &
00026                                           nbr_points_per_lat, ierror)
00027 
00028    use psmile_user_data, only : grid_data, test_user_grid_id
00029    use prism_constants, only : PRISM_Error_Arg
00030    use psmile_common, only : ch_id
00031 
00032    implicit none
00033 
00034    integer, intent (in)                :: grid_id
00035    integer, intent (in)                :: nbr_latitudes
00036    integer, intent (in)                :: nbr_points_per_lat(nbr_latitudes)
00037    integer, intent (out)               :: ierror
00038 
00039 #ifdef VERBOSE
00040    print 9990, trim(ch_id)
00041    call psmile_flushstd
00042 #endif /* VERBOSE */
00043 
00044    ierror = 0
00045    call test_user_grid_id(grid_id, ierror)
00046 
00047    if (associated (grid_data(grid_id)%nbr_points_per_lat)) then
00048 
00049       ierror = PRISM_Error_Arg
00050       call psmile_error ( PRISM_Error_Arg, 'reduced grid map data already existed', &
00051                           (/grid_id/), 1, __FILE__, __LINE__ )
00052       return
00053    endif
00054 
00055    allocate (grid_data(grid_id)%nbr_points_per_lat(nbr_latitudes))
00056    grid_data(grid_id)%nbr_points_per_lat = nbr_points_per_lat
00057 
00058 #ifdef VERBOSE
00059    print 9980, trim(ch_id), ierror
00060    call psmile_flushstd
00061 #endif /* VERBOSE */
00062 
00063 9990 format (1x, a, ': psmile_store_data_reducedgrid: ')
00064 9980 format (1x, a, ': psmile_store_data_reducedgrid: eof ierror =', i5)
00065 end subroutine psmile_store_data_reducedgrid

Generated on 18 Mar 2011 for Oasis4 by  doxygen 1.6.1