psmile_trf_lonlat_1d_real.F90

Go to the documentation of this file.
00001 !-----------------------------------------------------------------------
00002 ! Copyright 2006-2010, NEC Europe Ltd., London, UK.
00003 ! All rights reserved. Use is subject to OASIS4 license terms.
00004 !-----------------------------------------------------------------------
00005 !BOP
00006 !
00007 ! !ROUTINE: PSMILe_Trf_lonlat_1d_real
00008 !
00009 ! !INTERFACE:
00010 
00011       subroutine psmile_trf_lonlat_1d_real (x_coords, y_coords,             &
00012                                             coords_shape, grid_valid_shape, &
00013                                             sin_values_lon, cos_values_lon, &
00014                                             sin_values_lat, cos_values_lat, &
00015                                             ierror)
00016 !
00017 ! !USES:
00018 !
00019       use PRISM_constants
00020 !
00021       use PSMILe, dummy_interface => PSMILe_Trf_lonlat_1d_real
00022 
00023       implicit none
00024 !
00025 ! !INPUT PARAMETERS:
00026 !
00027       Integer, Intent (In)            :: coords_shape (2, ndim_2d)
00028 
00029 !     Dimension of coordinates (method) x_coords, ...
00030 
00031       Real, Intent (In)               :: x_coords(coords_shape(1,1): 
00032                                                   coords_shape(2,1))
00033       Real, Intent (In)               :: y_coords(coords_shape(1,2): 
00034                                                   coords_shape(2,2))
00035 
00036 !     Coordinates of the method
00037 
00038       Integer, Intent (In)            :: grid_valid_shape (2, ndim_2d)
00039 
00040 !     Specifies the valid block shape for the "ndim_3d"-dimensional block
00041 
00042 !
00043 ! !OUTPUT PARAMETERS:
00044 !
00045       Real, Intent (Out)              :: sin_values_lon (grid_valid_shape(1,1): 
00046                                                          grid_valid_shape(2,1))
00047       Real, Intent (Out)              :: sin_values_lat (grid_valid_shape(1,2): 
00048                                                          grid_valid_shape(2,2))
00049 
00050 !     Arrays returning the sin values for lon and lat
00051 
00052       Real, Intent (Out)              :: cos_values_lon (grid_valid_shape(1,1): 
00053                                                          grid_valid_shape(2,1))
00054       Real, Intent (Out)              :: cos_values_lat (grid_valid_shape(1,2): 
00055                                                          grid_valid_shape(2,2))
00056 
00057 !     Arrays returning the cos values for lon and lat
00058 !
00059       Integer, Intent (Out)           :: ierror
00060 
00061 !     Returns the error code of PSMILE_Trf_lonlat_1d_real;
00062 !             ierror = 0 : No error
00063 !             ierror > 0 : Severe error
00064 !
00065 ! !LOCAL VARIABLES
00066 !
00067 !     ... for error handling
00068 !
00069 !     Integer, parameter              :: nerrp = 2
00070 !     Integer                         :: ierrp (nerrp)
00071 !
00072 !
00073 ! !DESCRIPTION:
00074 !
00075 ! Subroutine "PSMILe_Trf_lonlat_1d_real" computes sin and cos values of
00076 ! the Longitudes and Latitudes of a 2d-dimensional grid of type
00077 ! "PRISM_Reglonlatvrt".
00078 !
00079 ! !REVISION HISTORY:
00080 !
00081 !   Date      Programmer   Description
00082 ! ----------  ----------   -----------
00083 ! 03.07.21    H. Ritzdorf  created
00084 !
00085 !EOP
00086 !----------------------------------------------------------------------
00087 !
00088 !  $Id: psmile_trf_lonlat_1d_real.F90 2325 2010-04-21 15:00:07Z valcke $
00089 !  $Author: valcke $
00090 !
00091    Character(len=len_cvs_string), save :: mycvs = 
00092        '$Id: psmile_trf_lonlat_1d_real.F90 2325 2010-04-21 15:00:07Z valcke $'
00093 !----------------------------------------------------------------------
00094 !
00095 !  Initialization
00096 !
00097 #ifdef VERBOSE
00098       print 9990, trim(ch_id)
00099 
00100       call psmile_flushstd
00101 #endif /* VERBOSE */
00102 
00103       ierror = 0
00104 !
00105 #ifdef PRISM_ASSERTION
00106 #endif
00107 !
00108 !===> Transform from degrees into radients
00109 !
00110       sin_values_lon (:) = &
00111         x_coords (grid_valid_shape(1,1):grid_valid_shape(2,1)) *      &
00112         real_deg2rad
00113 !
00114       sin_values_lat (:) = &
00115         y_coords (grid_valid_shape(1,2):grid_valid_shape(2,2)) *      &
00116         real_deg2rad
00117 !
00118 !===> Compute cos and sin values
00119 !
00120       cos_values_lon = cos (sin_values_lon)
00121       cos_values_lat = cos (sin_values_lat)
00122 !
00123       sin_values_lon = sin (sin_values_lon)
00124       sin_values_lat = sin (sin_values_lat)
00125 !
00126 !===> All done
00127 !
00128 #ifdef VERBOSE
00129       print 9980, trim(ch_id), ierror
00130 
00131       call psmile_flushstd
00132 #endif /* VERBOSE */
00133 !
00134 !  Formats:
00135 !
00136 9990 format (1x, a, ': psmile_trf_lonlat_1d_real')
00137 9980 format (1x, a, ': psmile_trf_lonlat_1d_real: eof, ierror =', i3)
00138 
00139       end subroutine PSMILe_Trf_lonlat_1d_real

Generated on 18 Mar 2011 for Oasis4 by  doxygen 1.6.1