psmile_char2buf.F90
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011 subroutine psmile_char2buf (ilubuf, ndibuf, ipos, string)
00012
00013
00014
00015 use psmile_common, dummy_interface => PSMILe_Char2buf
00016
00017 implicit none
00018
00019
00020
00021 character (len=*), Intent(in) :: string
00022
00023
00024
00025 integer, Intent(in) :: ndibuf
00026
00027
00028
00029
00030
00031
00032 integer, Intent(inout) :: ipos
00033
00034
00035
00036
00037 integer, Intent(inout) :: ilubuf (ndibuf)
00038
00039
00040
00041
00042
00043 character (len=12) :: form
00044 integer :: i, ilen, irest, lav, lenstr
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060
00061
00062
00063
00064
00065
00066
00067
00068
00069
00070
00071 Character(len=len_cvs_string), save :: mycvs =
00072 '$Id: psmile_char2buf.F90 2325 2010-04-21 15:00:07Z valcke $'
00073
00074
00075
00076
00077
00078 lenstr = len (string)
00079 ilen = (lenstr-1) / length_of_integer
00080
00081 lav = ndibuf - ipos
00082
00083
00084
00085 irest = lenstr - ilen*length_of_integer
00086
00087 if (ilen .gt. 0) then
00088 write (form, 9990) ilen, length_of_integer, irest
00089 else
00090 write (form, 9980) irest
00091 endif
00092
00093
00094
00095 read (string, form) (ilubuf(ipos+i), i= 1, min (ilen+1, lav))
00096
00097 ipos = ipos + (ilen+1)
00098
00099 return
00100
00101
00102
00103 9990 format ('(', i4, 'a', i1, ', a', i1, ')')
00104 9980 format ('(a', i1, ')')
00105 end