psmile_trf_lonlat_3d_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_3d_real
00008 !
00009 ! !INTERFACE:
00010 
00011       subroutine psmile_trf_lonlat_3d_real (x_coords, y_coords,             &
00012                                             coords_shape, grid_valid_shape, &
00013                                             sin_values, cos_values, ierror)
00014 !
00015 ! !USES:
00016 !
00017       use PRISM_constants
00018 !
00019       use PSMILe, dummy_interface => PSMILe_Trf_lonlat_3d_real
00020 
00021       implicit none
00022 !
00023 ! !INPUT PARAMETERS:
00024 !
00025       Integer, Intent (In)            :: coords_shape (2, ndim_3d)
00026 
00027 !     Dimension of coordinates (method) x_coords, ...
00028 
00029       Real, Intent (In)               :: x_coords(coords_shape(1,1): 
00030                                                   coords_shape(2,1), 
00031                                                   coords_shape(1,2): 
00032                                                   coords_shape(2,2), 
00033                                                   coords_shape(1,3): 
00034                                                   coords_shape(2,3))
00035       Real, Intent (In)               :: y_coords(coords_shape(1,1): 
00036                                                   coords_shape(2,1), 
00037                                                   coords_shape(1,2): 
00038                                                   coords_shape(2,2), 
00039                                                   coords_shape(1,3): 
00040                                                   coords_shape(2,3))
00041 
00042 !     Coordinates of the method
00043 
00044       Integer, Intent (In)            :: grid_valid_shape (2, ndim_3d)
00045 
00046 !     Specifies the valid block shape for the "ndim_3d"-dimensional block
00047 
00048 !
00049 ! !OUTPUT PARAMETERS:
00050 !
00051       Real, Intent (Out)              :: sin_values (grid_valid_shape(1,1): 
00052                                                      grid_valid_shape(2,1), 
00053                                                      grid_valid_shape(1,2): 
00054                                                      grid_valid_shape(2,2), 
00055                                                      grid_valid_shape(1,3): 
00056                                                      grid_valid_shape(2,3), 
00057                                                      2)
00058 
00059 !     Array returning the sin values for lon and lat
00060 
00061       Real, Intent (Out)              :: cos_values (grid_valid_shape(1,1): 
00062                                                      grid_valid_shape(2,1), 
00063                                                      grid_valid_shape(1,2): 
00064                                                      grid_valid_shape(2,2), 
00065                                                      grid_valid_shape(1,3): 
00066                                                      grid_valid_shape(2,3), 
00067                                                      2)
00068 
00069 !     Array returning the cos values for lon and lat
00070 !
00071       Integer, Intent (Out)           :: ierror
00072 
00073 !     Returns the error code of PSMILE_Trf_lonlat_3d_real;
00074 !             ierror = 0 : No error
00075 !             ierror > 0 : Severe error
00076 !
00077 ! !DEFINED PARAMETERS:
00078 !
00079 !  lon   = Index of Longitudes in arrays "sin_values" and "cos_values"
00080 !  lat   = Index of Latitudes  in arrays "sin_values" and "cos_values"
00081 !
00082       Integer, parameter              :: lon = 1
00083       Integer, parameter              :: lat = 2
00084 !
00085 ! !LOCAL VARIABLES
00086 !
00087 !     ... for error handling
00088 !
00089 !     Integer, parameter              :: nerrp = 2
00090 !     Integer                         :: ierrp (nerrp)
00091 !
00092 !
00093 ! !DESCRIPTION:
00094 !
00095 ! Subroutine "PSMILe_Trf_lonlat_3d_real" computes sin and cos values of
00096 ! the Longitudes and Latitudes of a 3d-dimensional grid of type
00097 ! "PRISM_Irrlonlatvrt".
00098 !
00099 ! !REVISION HISTORY:
00100 !
00101 !   Date      Programmer   Description
00102 ! ----------  ----------   -----------
00103 ! 03.07.21    H. Ritzdorf  created
00104 !
00105 !EOP
00106 !----------------------------------------------------------------------
00107 !
00108 !  $Id: psmile_trf_lonlat_3d_real.F90 2325 2010-04-21 15:00:07Z valcke $
00109 !  $Author: valcke $
00110 !
00111    Character(len=len_cvs_string), save :: mycvs = 
00112        '$Id: psmile_trf_lonlat_3d_real.F90 2325 2010-04-21 15:00:07Z valcke $'
00113 !----------------------------------------------------------------------
00114 !
00115 !  Initialization
00116 !
00117 #ifdef VERBOSE
00118       print 9990, trim(ch_id)
00119 
00120       call psmile_flushstd
00121 #endif /* VERBOSE */
00122 
00123       ierror = 0
00124 !
00125 #ifdef PRISM_ASSERTION
00126 #endif
00127 !
00128 !===> Transform from degrees into radients
00129 !
00130       sin_values (:, :, :, lon) = &
00131         x_coords (grid_valid_shape(1,1):grid_valid_shape(2,1),        &
00132                   grid_valid_shape(1,2):grid_valid_shape(2,2),        &
00133                   grid_valid_shape(1,3):grid_valid_shape(2,3)) *      &
00134         real_deg2rad
00135 !
00136       sin_values (:, :, :, lat) = &
00137         y_coords (grid_valid_shape(1,1):grid_valid_shape(2,1),        &
00138                   grid_valid_shape(1,2):grid_valid_shape(2,2),        &
00139                   grid_valid_shape(1,3):grid_valid_shape(2,3)) *      &
00140         real_deg2rad
00141 !
00142 !===> Compute cos and sin values
00143 !
00144       cos_values = cos (sin_values)
00145       sin_values = sin (sin_values)
00146 !
00147 !===> All done
00148 !
00149 #ifdef VERBOSE
00150       print 9980, trim(ch_id), ierror
00151 
00152       call psmile_flushstd
00153 #endif /* VERBOSE */
00154 !
00155 !  Formats:
00156 !
00157 9990 format (1x, a, ': psmile_trf_lonlat_3d_real')
00158 9980 format (1x, a, ': psmile_trf_lonlat_3d_real: eof, ierror =', i3)
00159 
00160       end subroutine PSMILe_Trf_lonlat_3d_real

Generated on 18 Mar 2011 for Oasis4 by  doxygen 1.6.1