Professional Documents
Culture Documents
Tom Hijnekamp
TU Delft | Deltares
Site Investigation based on Return Flow
in Horizontal Directional Drilling
Marsdiep Project
Master Thesis
This thesis is confidential and cannot be made public until September 1, 2016.
When I started the context of my thesis was roughly known, ie. within the Marsdiep project at Deltares there
were different subjects suitably for a master thesis. The Marsdiep project was the investigation into the feasibility
of constructing a pipeline between Texel and Den Helder using Horizontal Directional Drilling (HDD).
At the start in March I wrote a research proposal, in which I was not only going to relate the samples to the
soil by studying the influences on and the processes going on in the drilling fluid but I was going to correct the
initial estimation of the formation parameters as well. Unfortunately for me it turned out to be as ambitious as
unrealistic given the scope of the data acquisition (on which I had very limited influence due to contractual and
financial requirements) and the time restraints. As soon as this became clear I decided to change the focus of this
research.
Since my background is Applied Earth Sciences I decided to focus more on the geology. Increasing the scale
and limiting the scope to a more reasonable level, allowed me to take more distance from the fluid and transport
processes going on in the borehole.
In order to improve the geological cross-section I still required the source locations of the samples. The
source locations are calculated by rewriting, expanding and adapting a method I used on site in Den Helder to
calculate the diameter of the borehole during a flow test. After some trial and error and a significant amount of
time spend on data processing, the results can be found in this thesis.
Of course I could not have done this without support and input from others. First I would like to thank my
graduation committee for their support. Without detracting from the input and efforts of the other members of
the graduation committee, I would especially like to thank Dianne Den Hamer, from TU Delft, who was working
for Deltares on site in both Texel and Den Helder, and was very helpful in getting this research to the point where
it is now. From André Pietjouw from Episcope, Jonno Pouw and Ton Bennen, both from PWN and all present on
site in both locations, I learned a lot about the HDD process as well as about regular practice in the construction
industry, for which I am thankful.
Furthermore I would like to thank the following persons that were working on the Marsdiep project and
related projects and were always available for questions; Wim Post, David Nugroho and Mike Woning, all
working at Deltares. I would also like to thank Dick Mastbergen and Arno Talmon, both working at Deltares, for
their help with questions I had with regard to fluid properties and processes. From Deltares I would also like to
thank Jonathan Nuttall for his help and patience with regards to programming related issues. In addition I want
to thank Freek Busschers and Jeroen Schokker, both working at TNO, for identifying the samples and helping
me understand the geology of the region.
Last but not least I would like to thank my friends and family. By asking questions and showing interest they
forced me to take a look from different perspectives which led to new insights and improvements of this research.
Tom Hijnekamp
Delft, April 2016
iii
Abstract
The focus of this research is on samples taken from the return flow. With these samples and within the context of
the Marsdiep project it is investigated if Horizontal Directional Drilling (HDD) can be used as a Site Investigation
(SI) technique. In the Marsdiep project the feasibility of a pipeline constructed using HDD between the island
Texel and Den Helder is investigated. Marsdiep is the name of the water and tidal gully between Texel and
Den Helder. Regular SI techniques are not feasible, due to among others; the length of 4.5km, the depth that is
required for a HDD of this length and the tidal gully.
The geology of the area is unknown so SI is required. For this purpose pilot drillings, the first part of a regular
HDD project, are made at NAP-65m and NAP-85m from both Texel and Den Helder. These pilot drillings are
adapted so that additional data are acquired.
The rheologic properties are determined for samples taken from the return flow and the formation of the
samples is determined after sieving.
A range of possible source locations of the samples are calculated, using different scenarios based on the
uncertainty with regards to the borehole diameter and the loss of drilling fluid. The results of the scenarios are
compared to the results of the initial SIs, which consists of a seismic survey, onshore, vertical drillings and Cone
Penetration Tests (CPTs). It is found that the source location of the samples can be calculated as one of the
scenarios gave accurate results (scenario 5, drilling fluid loss 7% and a borehole diameter of 0.4m and 0.45m for
respectively Texel and Den Helder).
A geological cross-section is constructed based on the results of scenario 5 and initial SIs.
In addition to the geology the suitability of HDD as a SI technique is investigated. It is found that with minor
adaptations to a regular HDD it can be used in combination with other techniques to determine the geology of an
area. The other SIs are required to compare the results to and to determine the best scenario.
In order for HDD to be of use as a separate SI technique more extensive adaptations are required to minimize
the uncertainties that required the use of scenarios in this research.
iv
Samenvatting
De nadruk van dit ondezoek ligt op samples die genomen zijn van de return flow. Met deze samples en in
het kader van het Marsdiep project is ondezocht of het mogelijk is horizontaal gestuurd boren te gebruiken als
grondonderzoek techniek. In het Marsdiep project wordt de haalbaarheid ondezocht van het maken van een
pijplijn tussen Texel en Den Helder gebruik makend van gestuurd boren. Marsdiep is de naam van het water en
de getijden geul tussen Texel en Den Helder. Reguliere grondonderzoek technieken zijn niet wenselijk wegens
onder andere de lengte van 4.5 km, de benodigde diepte voor een gestuurde boring van deze lengte en de getijden
geul.
De geologie in dit gebied is onbekend dus grondonderzoek is nodig. Met dit doel zijn er pilot boringen, de
eerste fase van een regulier gestuurd boren project, uitgevoerd op NAP-65m en NAP-85m van zowel Texel als
Den Helder. Deze pilot boringen zijn aangepast zodat er extra data kunnen worden verzameld.
De vloeistof eigenschappen van de samples uit de return flow is bepaald en de formatie van de samples is
bepaald na zeving.
Een bereik aan mogelijke oorsprong locaties is berekend, gebruik makend van verschillende scenarios geba-
seerd op de onzekerheden met betrekking tot the diameter en het verlies van boorvloeistof. De resultaten van
de verschillende scenarios zijn vergeleken met de resultaten van een initieel grondonderzoek, wat bestaat uit
seismisch onderzoek, verticale boringen op Texel en in Den Helder en meerdere Cone Penetration Tests (CPT’s).
Uit dit onderzoek blijkt dat het mogelijk is om de oorsprong te berekenen aangezien de resultaten van een van
de scenarios goed kloppen wat al bekend was (scenario 5, 7% verlies van boorvloeistof en een boorgat diameter
van 0.4m en 0.45m voor respectievelijk Texel en Den Helder.).
Een geologische doorsnede is gemaakt op basis van de resultaten van scenario 5 en van de initieele grondon-
derzoeken.
Ook is de geschiktheid van gestuurd boren als grondonderzoek techniek onderzocht. Het blijkt dat met kleine
aanpassing ten opzichte van een reguliere boring het gebruikt kan worden in combinatie met andere grondonder-
zoek technieken om de geologie van het gebied te bepalen. De andere grondonderzoek technieken zijn nodig om
de resultaten mee te kunnen vergelijken en zo het meest waarschijnlijke scenario te bepalen.
Om gestuurd boren als enige techniek te gebruiken zijn meer en uitgebreidere aanpassingen nodig om de
onzekerheden te minimaliseren die het gebruik van scenarios vereisten in dit onderzoek.
v
Contents
Preface iii
Abstract iv
Samenvatting v
Abbreviations xi
Definitions xiii
Symbols xv
1 Introduction 1
1.1 Goal . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
1.2 Thesis structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
2 Literature Review 3
2.1 Geology . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
2.1.1 Geological History . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
2.2 Risks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
2.2.1 Project Risks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
2.2.2 General Risks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
2.3 HDD . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
2.3.1 History of HDD (research) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
2.3.2 The HDD Process . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
2.4 Comparison of HDD with Directional Drilling (DD) . . . . . . . . . . . . . . . . . . . . . . . 12
3 Marsdiep Project 13
3.1 Locations and Dimensions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
3.1.1 Initial Cross-section . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
3.1.2 Site Investigations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
3.2 Calculations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
3.3 Alignment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
4 Pilot Drilling Descriptions 17
4.1 Site Setup and Data Acquisition . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
4.2 Description of the Pilot Drillings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
4.2.1 Tests . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
4.2.2 Texel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
4.2.3 Den Helder . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
4.3 Sampling Method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
4.4 Suitability of HDD for SI . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
5 Processes 23
5.1 Literature Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
5.2 Different Fluid Models . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
5.2.1 Determination of Bingham Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . 24
5.2.2 Determination of Herschel-Bulkley Parameters . . . . . . . . . . . . . . . . . . . . . . 24
5.2.3 Comparison Fluid Models and Determination Methods . . . . . . . . . . . . . . . . . . 25
5.3 Flow of Drilling Fluids . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
5.3.1 Infiltration Loss . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
5.4 Transport. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
5.4.1 Transport Parameter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
5.5 Lag Time or Source Location . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
vii
viii Contents
6 Methodology 35
6.1 Equipment and Tests . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
6.2 SampleSource Program. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
6.2.1 Calculation of the Source Location (Intersection Method) . . . . . . . . . . . . . . . . . 36
6.2.2 Scenarios. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
6.3 MarsdiepVisual Program . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
6.4 Fixes Program . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
7 Measurements 45
7.1 Supplied Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45
7.1.1 ProData System . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45
7.1.2 Survey Data (Drilling Paths) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46
7.1.3 Driller Log . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50
7.1.4 Drill Company Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50
7.2 Acquired Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51
7.2.1 On site . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51
7.2.2 Deltares, Delft . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53
8 Interpretation 55
8.1 Drilling Fluid. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55
8.1.1 Fluid Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55
8.1.2 Time Dependent Behavior . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59
8.2 Transport and Flow Processes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60
8.2.1 Flow Type . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60
8.2.2 Infiltration Loss . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60
8.2.3 Transport. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60
8.3 Sample Identification . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61
8.4 Source Location . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64
8.4.1 Lag Diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66
8.5 Cross-section . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68
8.6 Improved Cross-section . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77
8.7 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80
9 Conclusions 81
9.1 Drilling Fluid. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81
9.1.1 Fluid Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81
9.1.2 Time Dependent Behavior . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81
9.1.3 Transport and Flow Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81
9.2 Source Location . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82
9.2.1 Lag Diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82
9.3 Cross-section . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82
9.4 Suitability of HDD for SI . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82
10 Recommendations 85
10.1 Drilling Fluid. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85
10.1.1 Rheological Data Acquisition. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85
10.1.2 Fluid Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85
10.1.3 Processes. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85
10.2 Source Location . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85
10.3 Cross-section . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 86
10.4 Suitability of HDD for SI . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 86
Bibliography 89
Appendices 93
A Geology Background 96
B Initial Site Investigations, Proposals and Calculations 103
C Equipment and Tests 113
Contents ix
API
American Petroleum Institute
BH
Bingham
BTL
Boren van Tunnels en Leidingen. Translated into English; drilling tunnels and pipelines.
BX
Boxtel Formation
CPT
Cone Penetration Test
DD
Directional Drilling
DR
Drente Formation
DS
Drillstring
EC
Electro-conductivity
EE
Eem Formation
EE-URTY
Eem Formation, Urk Tynje section
EE-BB
Eem Formation, Bruine Bank section
GBB
Gezamelijk Basisonderzoek Boortechnieken. Translated into English it is; joint fundamental research
drilling techniques.
HB
Herschel-Bulkley
xi
xii Abbreviations
HDD
Horizontal Directional Drilling
KR
Kreftenheye Formation
NA
Naaldwijk Formation
NAP
Normaal Amsterdams Peil, Translated into English; Amsterdam Ordnance Datum.
PE
Peelo Formation
PENI
Peelo Formation, Nieuwolda section
PPI
Plastics Pipe Institute
PZ
Peize Formation
ROP
Rate Of Penetration
RPM
Rotations Per Minute
SI
Site Investigation
TBM
Tunnel Boring Machine
URVE
Urk Formation, Veenhuizen section
Definitions
A.Hak-Drillcon
Drillcon is the department of the firm A.Hak that is concerned with horizontal drilling. It was the main
contractor in Texel.
Backflow
Pressure driven flow, that comes out of the borehole while the pumps are off.
Carriage
The part of the rig that is connected to the drillstring, the drill fluid flows through it and it delivers the
pushing force on the drillstring.
Coupling Time
The time required to attach or detach a pipe from the Drillstring (DS), during which the pumps are off.
Critical flow
The minimum annular average fluid velocity that would prevent stationary accumulation of cuttings in a
bed (Pilehvari et al., 1999).
Deltares
A Major Technological Research Institute in the Netherlands which is concerned with research in the areas
of water, soil and infrastructure.
DGeoPipeline
Deltares program for calculations on pipelines.
DINO
A database maintained by TNO, containing most of the Site Investigations (SIs) executed in the Nether-
lands. DINO stands for ’Data en Informatie van de Nederlandse Ondergrond’, translated into English it is;
Data and information of the Dutch subsurface.
Directional drilling
This term is used to make a distinction between the use of directional drilling in the petroleum industry,
often referred to as directional drilling, and construction industry, where the drilling method is called
horizontal directional drilling.
Drillstring
A set of pipes, also called joints, connecting the drill bit to the drill rig, transports the drilling fluid to the
drill front and can contain a cable for data transfer between the drill and the surface.
GeoTOP
A model of the dutch soil that currently spans parts of the Netherlands, with a grid size of 100x100m and
vertical resolution of 0.5 meter.
xiii
xiv Definitions
Joint
A pipe of the drillstring, the joint number is the number of pipes in the borehole.
LMR
LMR is the part of a larger group of companies called Ludwig Freytag that is concerned with horizontal
drilling. It was the main contractor in Den Helder.
Mud cake
Plastering takes place in the borehole; other names include: filter cake, external plaster.
Mud crust
Plastering takes place in the formation; other names include: mud spurt, internal plaster.
Mud pulse
A system that sends pressure pulses through the drilling fluid in the drillstring in order to transfer data from
the drill head to the surface.
PWN
Drinking water company, responsible for the environmental management of dunes along the coast of North
Holland and the transport infrastructure in this region. The client for the Marsdiep project.
RD Coordinates or Rijksdriehoekscoördinaten
The national coordinate system of the Netherlands.
Reamer
A drill head used in increasing the diameter of an existing borehole.
Return flow
The drilling fluid coming out of the borehole.
Soil parameters
The parameters of the soil, with regard to the strength or permeability for example.
TNO
A Major Technological Research Institute in the Netherlands which has as goal: "TNO connects people and
knowledge to create innovations that boost the sustainable competitive strength of industry and well-being
of society." It is active in a number of different work areas.
Tripping
There are two types of tripping. Tripping back; pulling back the DS. Tripping in; moving forward in an
existing borehole. For example after changing the jet bit to a mud motor.
Symbols
xv
xvi Symbols
Re Reynolds number —
Re g en, f ul l Reynolds number, generalized —
R f ac A factor for the hydraulic diameter, 1.5 for an annulus —
Ri Radius of the drillstring m
Ro Radius of the borehole m
ROP Rate of Penetration m/s
ROP The average Rate of Penetration m/s
ψ Scaling factor used in correcting the yield point for a more accurate result in the —
Herschel Bulkley model
γ Shear rate 1/s
γ̇i Shear rate at setting i of the viscometer 1/s
γr f The shear rate of the return flow 1/s
τ Shear stress Pa
S D X (Hor.) The x-coordinate of the source of the cuttings, on the horizontal part of the boring m
S D X (I ncl .) The x-coordinate of the source of the cuttings, on the inclined part of the boring m
S DY (Hor.) The y-coordinate of the source of the cuttings, on the horizontal part of the boring m
S DY (I ncl .) The y-coordinate of the source of the cuttings, on the inclined part of the boring m
τi ,c al c Calculated shear stress at setting i of the viscometer Pa
τi ,d at a Measured shear stress at setting i of the viscometer Pa
τw Shear stress due to friction Pa
τy Yield stress of the fluid Pa
ts Average time that a grain is present in the fluid in the borehole s
t Relative settle time s
tk Average time that is required for a grain to settle s
Yg A transport parameter found in BTL 42 —
ΨT b Dimensionless transport parameter —
ΦT b Transport capacity for bed flow —
ΦT p Transport capacity for plug flow —
v Dr i l l The average drill velocity m/s
vr f Flow velocity of the mixture containing drilling fluid and soil m/s
v set t l e Settle velocity grain m/s
µ Viscosity of the drilling fluid P a.s
µ∞ Constant viscosity at very high shear rates P a.s
wi Weighting factor, given by τi − τ y —
ya Infiltration depth m
yc Cake thickness m
YP Yield point as used in the Bingham Model Pa
1
Introduction
The drinking water of Texel, an island in the northern part of the Netherlands, is supplied from the mainland
through two pipes in shallow trenches in the seabed of the Marsdiep. In 2013 the cover above one of these pipes
eroded. The pipe floated up and started to scour along the seabed under influence of the tidal currents. This
movement slowly increased the free floating length and caused an increase in stresses in the pipe. The scouring
wore the pipe wall down, where it left the seabed, to such an extent that the material failed to cope with the
stresses and started to leak before breaking (Mesman et al., 2014). During a heatwave in the summer from that
year, additional water had to be transported to Texel to meet the demand.
In order to prevent this from happening again an investigation is started in order to determine whether a
pipeline at considerable depth could be constructed using Horizontal Directional Drilling (HDD). This investi-
gation is known as the Marsdiep project, named after the waterway between Texel and the mainland.
However, the geology between Texel and Den Helder is unknown and due to the location standard Site
Investigations (SIs) techniques as required for more conventional HDD projects, ie. crossing a river or road,
would be too expensive. Therefore it is relevant to know if HDD can be used as an alternative to regular SIs.
Initial SIs have taken place and consist of one onshore vertical drilling and four Cone Penetration Tests (CPTs)
on both sides and a seismic survey of the Marsdiep.
With a length of more than 4 kilometer this is one of, if not the longest HDD project to date. This means
that the forces and required pressures are considerably higher than during a regular project. Due to the pressure
required to transport the soil in the borehole to the surface the required depth is considerable. To lower the
required pressure ’meeting in the middle’ is proposed, this halves the distance the soil needs to be transported.
’Meeting in the middle’ entails drilling from both sides and when one drilling is positioned above the borehole
of the other drilling it is gradually lowered till there is one borehole.
In order to investigate the soil pilot drillings are planned. A pilot drilling is the first phase of a HDD project.
A preliminary design is constructed based on the available data. This design will be checked and improved based
on results of the pilot drillings.
Although HDD is used in the Netherlands since the seventies of the previous century, numerous aspects are
less than well understood. In order to address these uncertainties additional data are gathered on site.
1.1. Goal
The goals of this research must be seen within the context of the following broader research question: is HDD
suitable as a SI technique? The focus of this research is on the samples taken from the return flow. The goal of
this research is to answer the following questions:
• Is it achievable to connect samples from the return flow to a source location in the subsurface?
• Is it possible to create a cross-section with the results of the samples from the return flow?
• Is HDD suitable as a SI technique and can it be improved, based on experiences in the field?
Furthermore the drilling fluid is an important item in this thesis. An investigation of the drilling fluid is required
in order to investigate and answer the first question.
Chapter 3 briefly presents the Marsdiep project and the initial SIs.
1
2 1. Introduction
Chapter 6 presents the programs and method created in order to reach the goals of this thesis.
Chapter 7 presents characteristic measurements of the pilot drillings. These include measurements taken in the
laboratory as well as taken from the drilling rig.
Chapter 8 presents the interpretation of measurements as well as the results of the programs, eg. the fluid model
and source locations for the samples.
Chapter 9 presents the conclusions and chapter 10 contains the recommendations for further research.
2.1. Geology
In order to know which processes occur in the borehole during HDD the geology needs to be known. Based
on the description in the literature, databases and on the preliminary survey consisting of boreholes, CPTs and
seismic data, the formations are identified and very briefly described in (Nugroho and van Meerten, 2015). The
English description of the formations can be found in table A.2, appendix A. Table A.1, also in appendix A,
contains the grain size definitions.
Table 2.1 contains the formations encountered in the Marsdiep project. Within the aim of the thesis it is very
important to know more about these formations, in order to be able to correlate the spoils of the return flow to the
formations encountered. This is done by evaluating what is already known, collected and investigated by TNO,
a dutch institute which maintains the DINO database, which contains the results of most SIs performed in the
Netherlands. Figure 2.1 shows all of the formations found in the Netherlands that have been deposited during the
Quaternary. The descriptions from TNO are general but they are extensive with respect of what is possible and
give insights into the origin of the formations. On the differences in origin, a distinction might be made when
investigating soil samples from the return flow. The differences can be used to determine if the sample is mixed,
ie. contains characteristics of different formations, due to flow and transport processes in the borehole.
The investigation of the geology is divided in two parts; first the geologic history of the area and second the
formation descriptions.
3
4 2. Literature Review
Local Occurrence
Fm. Age Texel Den Helder
Naaldwijk (NA) 0.01 MA - Present Brown to gray, moderately Brown to gray, moderately
fine, weak to moderately silty fine, well sorted, weak silty
sand, which can contain traces sand, which can contain traces
of iron oxide, traces of micas, of organic material, traces of
shells, small clay layers and micas, shells and clay as well
traces of detritus at the bottom as some peat and gyttja layers
of the formation. at the bottom of the formation.
Boxtel (BX) 0.66 MA - Present Gray, very to moderately fine, Light brownish gray, very
moderately to very silty sand, fine, moderately sorted,
which can contain traces of or- slightly silty sand.
ganic material and small lay-
ers of peat and clay.
Kreftenheye (KR)* 0.24 MA - 0.01 MA Brownish, colored, coarse to medium grained sand. Can contain
peat, shell fragments and organic debris.
Eem (EE) 0.13 MA - 0.12 MA Gray to dark gray, well sorted Dark yellow to brownish gray,
sand, which can contain a few very sandy clay with micas
detritus layers at the top of or a brownish gray, very to
the formation, traces of col- moderately fine, well sorted,
ored material and clay layers. slightly silty sand with traces
of micas.
Urk - Tynje 0.85 MA - 0.13 MA Gray, moderately fine to very Light gray to gray, slightly
(URTY) coarse, slightly to very silty silty moderately coarse sand,
sand, with traces of colored with traces of organic material
material, shells, white quartz and shells and badly to moder-
and organic material and a ately well sorted.
variation in sorting.
Urk - Veenhuizen 0.85 MA - 0.13 MA Gray, weak silty moderately
(URVE) fine to moderately coarse
sand, with traces of colored
material, pink grains, few
black grains and well sorted.
Peelo - Nieuwolda 0.47 MA - 0.42 MA Dark gray, very strong clay
(PENI) - ’Pot Clay’ containing some gravel.
Peelo (PE) 0.47 MA - 0.42 MA Gray to dark gray, moderately
to badly sorted, moderately
coarse to very coarse sand,
which can contain silt, gravel
and traces of white quarts.
Appelscha (AP) 1.07 MA - 0.47 MA Gray, moderately to very
coarse, weak silty sand with
some shells and white quartz
grains.
* Not separately identified.
2.1. Geology
Figure 2.1: Overview of the formations found in the Netherlands, deposited during the Quaternary Period, with their age and
origin (TNO, 2013b).
5
6 2. Literature Review
2.2. Risks
A brief overview of the most important risks related to HDD projects are presented here. A complete overview
would be too extensive to present here. The risks are divided into specific to the project and risks related to HDD.
Table 2.2: An expanded selection of the risks identified in the initial research (Nugroho and van Meerten, 2015). The depths
are two of the three originally proposed depths, the other being NAP-45m. The pilot drillings are executed at
NAP-65m and NAP-85m.
Pot Clay
Pot Clay refers to the Nieuwolda section of the Peelo Formation. The formation is deposited during an ice age
and compressed by subsequent ice age. This formation is often present in deep incised valleys which can reach
a depth of hundreds of meters. The Pot Clay encountered in Texel is assumed to be the edge of such an incised
valley with orientation west-east and the valley further to the north. The clay of the Nieuwolda section is very
compact and is strong to very strong. It has a light to dark gray, brownish black to black color and can contain
chalk, micas and can be weak to moderately silty or sandy. The clay is glaciolacustrine deposit, which means
that it is deposited by meltwater at the edges of glaciers. The strength of the clay stems from subsidence of the
water-rich clay and compaction by a glacier during the Saale Glaciation.
Borehole Instability
Borehole instability can influence a project in multiple ways depending both on the length of the instability and
the severity of the instability, ie. the amount of additional soil that enters the borehole. The severity ranges
from ’raining in’ to total collapse of the borehole which results in damaged or loss of equipment. ’Raining in’ is
when well sorted soils are insufficiently supported by the drilling fluid and no interlocking occurs causing a slow
8 2. Literature Review
‘raining in’ of grains into the drilling fluid. If the amount of additional soil does not exceed the transport capacity
this won’t lead to total hole collapse. The following causes for borehole instability are identified (Kruse, 2009):
• Loosely packed granular soils.
• The presence of very permeable gravel layers, no mud crust and or mud cake is formed and thus the walls
are not stabilized.
• High groundwater pressure, for example in an aquifer.
• Groundwater flow.
• Extreme low strength of the layers.
• Chemical reaction of the drilling fluid with the groundwater, causing for example the drilling fluid to
flocculate.
• Chemical reaction of the drilling fluid with the soil.
Seepage
This term covers multiple processes and risks, it can be used to describes events ranging from blow outs to the
surface to leakage of groundwater into the borehole. The following causes for seepage are identified in (Kruse,
2009):
• A high hydraulic head in an aquifer, which exceeds the static downward pressure of the drilling fluid.
• Reduction of the density of the drilling fluid during the drilling phases.
• Excavations at the entry or exit point for the tie-in weld of the pipeline.
• Chemical reaction of drilling fluid with ground water.
• External caused of high groundwater pressure such as pipeline damage.
2.3. HDD
This section is subdivided into the History of HDD (research), and the HDD Process, with a focus on the Pilot
Phase, since that phase is where this thesis focuses on. In appendix C.2 a brief, general section can be found on
equipment used in HDD.
The crust and the cake also strengthen the wall of the borehole, increasing the borehole stability. The drilling
fluid transports the drilled soil to the surface where the fluid is recycled and pumped down again. In reality the
process is less simple due to a number of reasons and processes, for example the flow is not continuous due to
connection of new drill pipes at the surface.
Phases
The HDD process can be divided into different phases: pilot, reaming and pull in phase (Kruse, 2009; Denekamp
et al., 2000).
Pilot Phase
During this phase an initial hole is drilled from location A (entry point in figure 2.2a) to location B (exit point
in figure 2.2a). Behind the drill bit a steering tool is located in a non-magnetic part of the drill string, which
monitors the location and progress of the drill bit. In some cases, at or near the surface, a casing can be used. A
casing can be used to prevent blow out, erosion of the borehole and to prevent deviation from the planned drill
path through weak soils. The drill fluid flows back to the surface, between the drill string and the soil.
In some cases when the length of the drilling becomes too long the pilot boring is started from both sides, this
is called the intersect or meeting in the middle method. What is considered too long, depends on the project.
But in the Marsdiep project, where the intersect method is going to be applied, the reason is that the drilling
fluid pressure that is required to ensure proper borehole cleaning, would exceed the limit put on the drilling fluid
pressure with regard to blowout prevention.
Reaming Phase
During this phase the diameter of the borehole is increased in one or more steps to fit the final product pipe or
conduit, see figure 2.2b. To increase the borehole a reamer is pulled from location B to location A. During this
phase the drill fluid can flow to either or both sides of the borehole.
Pull In Phase
During this phase the pipe or conduit is pulled through from location B to location A. A reamer is pulled through
followed by a the pipe with a swivel in between to prevent torque, from the rotation of the drill string, on the pipe
or conduit, see figure 2.2c.
10 2. Literature Review
Figure 2.3: Illustration of rotary drilling and sliding, resulting in respectively a straight borehole and a turn (Royal et al.,
2010).
2.3. HDD 11
Position determination
Different methods can be used to determine the position of the drill head, depending on the local situation and
project. For example a commonly used method is the Walkover method. This uses a sonde, after the drill bit, that
sends an electro-magnetic signal to a hand held receiver on surface. This method is only suitable at limited depth
(<10 m) and the surface has to be free of steel structures. In both Texel and Den Helder a Gyro Steering Tool is
used. Advantages of the gyro method are (Brownline B.V., 2010):
• No disturbances due to magnetic interference.
• No access on surface required.
• No restriction in built-up areas.
• No limits on drill depth.
• Continuous measurements.
• Real time mud pressure in borehole.
To get the data on the surface initially a mudpulse is used in Texel. This device sends pressure pulses through the
drilling fluid to the surface which can be translated to data. Later the data transfer is switched to a cable within
the Drillstring (DS), see section 4.2.2 for the reasons behind this decision. Due to the cable being present in the
flow inside the DS, it can be damaged by the fluid. This caused delays in Texel since the equipment has to be
pulled back to replace the cable. In Den Helder data are transferred through a wire in the DS which in this case
caused no delays due to pulling the DS back for repairs.
Drilling Fluids
The drilling fluid often consists of a mixture of water with bentonite and/or polymers. Bentonite is a natural
occurring clay mineral (mostly montmorillinite), which, when mixed with water, can be used as a carrier fluid.
Different polymers can be added to create a fluid with exact specifications. Mixing drilling fluid becomes increas-
ingly difficult as different polymers are added since the polymers affect more than one property of the drilling
fluid. It is crucial to have a drilling fluid suitable for the project because of the following functions (Ariaratnam,
2001; Ariaratnam et al., 2007):
1. Transporting the drilled soil to the surface by suspending and carrying it in the flow.
2. Stabilizing the borehole, by creating a non- or low permeable mud cake or crust, the drilling fluid also
exerts a hydrostatic pressure on the surroundings. The combination prevents leakage into the borehole of
groundwater and prevents borehole collapse.
3. Keeping the drilling bit clean as well as cooling the equipment.
4. Lubricating the equipment and reducing the friction between the drill string and the wall of the borehole.
5. When a mud motor is used the fluid flow is powering the mud motor.
The most important factors in deciding what drilling fluid is to be used are the specific conditions at the project
site, so this has to be investigated properly. As is presented above point 3, 4 and 5 are site independent and almost
any fluid will fulfill these functions. Site conditions covers both the soil present as well as the groundwater
present, for example pH and salt content, since salt can cause the bentonite to flocculate and lead to a change in
the properties of the drilling fluid. The material which is used as a basis in Texel is an OCMA (a quality mark)
bentonite. In Den Helder, Teqgel (a mixture of bentonite and polymers in order to guarantee certain properties)
is used.
Advantages
HDD is a trenchless technique, which has advantages over more traditional trench technology, especially with
regards to the social costs, ie. disturbances of any kind, since it can be constructed more quickly, requires
less working space and can be used without disruption to the surface activities (traffic and pedestrian areas)
(Ariaratnam, 2001). In densely populated areas, such as the Netherlands, these advantages become extremely
significant.
HDD has some advantages when comparing it with other trenchless technologies as well. Examples are:
• No vertical shafts required, HDD operates from surface to surface.
• Relative short setup and installation time.
• Flexibility in the borehole alignment and thus the ability to evade obstacles. For example existing conduits
and pipelines.
• A longer installation length than achievable with other techniques in one drive (Allouche et al., 2003) as
cited in (Zayed and Mahmoud, 2013).
12 2. Literature Review
Figure 3.1: Cross-section generated in the program DGEOpipeline, based on the results of Cone Penetration Tests (CPTs) and
a seismic survey (Nugroho and van Meerten, 2015), with Texel on the left and Den Helder on the right side. The
‘_t’ and ‘_d’ in the figure correspond to identified in respectively Texel and Den Helder. In table 2.1 and table A.2
the abbreviations are elaborated on.
13
14 3. Marsdiep Project
Figure 3.2: The locations of the conducted onshore SIs, Den Helder (left) and Texel (right) (Nugroho and van Meerten, 2015).
The locations marked with a ‘B’ are the boreholes and those marked with ‘DKMP’ are CPT data points.
3.1. Locations and Dimensions
15
Figure 3.3: The cross-section as a result of the seismic survey (Mesdag et al., 2014).
16 3. Marsdiep Project
3.2. Calculations
Making use of, amongst others, the program DGeoPipeline and the cross-section presented in figure 3.1 a number
of preliminary calculations are made during the initial research into the feasibility of the project. The calculations
range from required pressures and limits with regards to fracturing and blowout to required push and pull forces.
Only the results of those calculations relevant for the pilot drilling are presented in appendix B.
3.3. Alignment
In figure 3.4 the alignment of the planned pilot drillings is presented. The pilot drilling alignment is close to but
does not cross the proposed alignments for the pipeline. This reduces the risk of interaction between the new
and old boreholes, which can cause unpredictable problems but the encountered soil during the pilot drillings is
similar to the soil during the construction of the pipeline.
An attempt is made to construct a fitting mass balance but this is hindered by numerous processes and missing
information. The data available for this purpose are manual read outs of flow meters on the pipes of the in- and
outflow. The outflow is measured on a pipe coming from the mud pit. The fluid level in the mud pit below the
casing varied. This caused a difference that is in the order of or larger than the losses occurring. This causes the
calculated loss to be negative at times. A negative loss would mean leakage from the surrounding groundwater
into the borehole. No evidence of this is found in the properties of the mud coming out of the borehole, neither
loss of properties due to dilution or abnormal increase in salt content, measured indirectly through the electro
conductivity. A small constant increase is present due to salt groundwater in the drilled soil, that is not filtered
out during recycling so the salinity of the inflow slowly increases.
An overview of the supplied data is inconvenienced by the amount of different sources, parameters, definitions
and formats used. Coupled with the different measuring frequencies and a difference in time between the sources
of data this can cause apparent contradictions and uncertainties. For both locations the supplied data can be
divided into 4 sources:
• The ProData system; All data are measured at the surface and most of it on the hydraulics of the rig. Mea-
surements are automated and this resulted in data, with a frequency of once every 3 seconds, concerning
carriage speed and position (the part of the drilling rig that pushes on the Drillstring (DS)), pull and push,
torque in both directions, rotation speed, pump pressure and pump rate.
• Survey data; acquired by multiple different companies and in one drilling by the drill company. The
supplied data sets vary by company but the majority is the same and consists of data, once every forward
going pipe of the DS, about the location of the drill head and the number of pipes (joint number).
• Driller log data; delivered by the driller. These data also contain the joint number and it is a continuous
data set, so when pulling back, the joint number is recorded as well. Furthermore for every joint the push
and pull, torque in both directions, drill time, rotation speed, pump rate and pump pressure are recorded.
The main difference with the Survey data is that tripping back is included in the driller data sets. The main
difference with the ProData system is that the data are estimations by the driller.
• Drill Company data; delivered by the drill company it contains a wide range of data with a varying degree
of usefulness, due to irregular or insufficient measuring frequency. It contains among others mud data,
photos and technical information of the used (drilling) equipment and data on the usage of materials.
17
18 4. Pilot Drilling Descriptions
(b) A flowchart of the site setup during the drilling in Den Helder.
Figure 4.2: Cross-section with the realized drill paths, with Texel of the left and Den Helder on the right side.
Planned Realized
Location Code Length [m] Depth [mNAP] Approximate Approximate
Length [m] Depth [mNAP]
PB1T-B 2500 -65 1700 -70
Texel
PB1T-C1 1500 -85 1500 -85
PB1DH-A1 1000 -65 1000 -65
Den Helder
PB1DH-A3 2000 -85 2000 -85
4.2.1. Tests
Two types of tests are used to determine different aspects of the drilling processes. To determine the gel-strength
of the drilling fluid and the stability of the borehole a stop test is done and to determine the average diameter of
the borehole a pill test is done.
Stop Test
The stop test is performed once in Texel and twice in Den Helder. It is executed after reaching the agreed end of
the drilling. The drilling is paused for a number of days and afterwards the conditions in the borehole are tested
to see what the effect of a stop is on borehole stability. When starting after the stop, the pumps are started first to
check if the return flow would start and to test the gel-strength of the drilling fluid. If the pressure generated by
the start of the pumps is insufficient to break the gel-strength of the fluid there are no returns. If this happens the
Drillstring (DS) is rotated to break the gel-strength of the drilling fluid. The order of starting is the opposite of
normal practice after a break. The start of the pumps before rotation of the DS causes increased annular pressure
with an increased risk of fracturing or blowouts. The stability of the borehole is determined while pulling the
drill back to the surface from the build-up of the required pulling force.
20 4. Pilot Drilling Descriptions
Pill Test
This test is performed twice in Den Helder. After a certain volume, a pill of a more viscous fluid is pumped down,
regular drilling fluid is pumped again. The time till the more viscous fluid reaches the surface is monitored so
the average diameter of the borehole can be calculated. The regular fluid is pumped down to prevent distortion
of the results of the stop test (since it would deviate from the reality), which is done after the pill test.
4.2.2. Texel
This project is different than regular projects in the HDD industry and this allowed the contractor in Texel to take
a different approach as well. A mud pulse is initially used to send the data from the drill bit to the surface, see
appendix C.2.1 for more information. After a few days filled with startup issues related to this and other systems
provided by a subcontractor, the company is replaced. The company responsible for the mud pulse system had a
gamma ray device installed which is to be read out at the end as well.
The PB1T-B drilling is executed first at a depth of between NAP-65m and NAP-70m, followed by the PB1T-
C1 Drilling at a depth of NAP-85m. The drillings are executed in shifts, 24 hours a day.
The drilling fluid is created using OCMA-grade Bentonite.
PB1T-B
Due to difficulties in steering in the layer with a jet bit, the first attempt build up a lot of friction and had to be
aborted at about 837m. A second attempt is made at another depth. In order to accomplish this without additional
friction the DS is pulled back to the corner before continuing forward while letting the jet bit fall down until a
more stable layer is reached. This creates one corner with a different radius than proposed, see figure 4.2 but did
not cause a significant increase of the friction on the DS. The new depth is around NAP-70m and the drilling is
aborted after about 1700m, 178 joints, of the proposed 2000m have been drilled. Drilling further is not possible
according to the contractor (van Meerten and Nugroho, 2015). In table 4.2 the observations from the drillers is
presented around that length. Due to the aborted end a stop test is not executed.
Table 4.2: Observations from the driller, joint 176 is approximately 1690m and joint 178 is approximately 1710m (van
Meerten and Nugroho, 2015).
PB1T-C1
This boring is executed according to plan. The drilling encountered a strong clay layer for a length of about 10
drill pipes while still going down. At a length of 1501m and a depth of NAP -85m a stop test is executed, with a
duration of two days.
4.3. Sampling Method 21
PB1DH-A2
In Den Helder a bottoms up travel time, the time it takes for fluid from the drill head to reach the surface, is
determined in a pill test at approximately 700m borehole length. The test is conducted while tripping back the
DS, in order to change from a jet bit to the mud motor. The pill test is however not as easy or accurate as
expected in this case, since during the tripping of the DS, large losses of drilling fluid are occurring of which
the exact quantity and location are unknown. At the same time backflow occurred making calculation even more
uncertain. This makes it very difficult or impossible to gain an accurate idea of the travel time due to the inability
to accurately calculate the diameter of the borehole due to the uncertainties with regards to the volume of the
drilling fluid. Another pill test is conducted after the end is reached with the mud motor. During this pill test the
pumping continued unhindered by any other activity and thus the result is much more reliable.
A stop test of 2 days is done after reaching the end at 2000m length and at a depth of NAP -85m. The stop
test went as expected. During tripping back the pull force required is higher than expected. The reason for this is
expected to be a minor hole instability caused by the abnormal high mud pressures compared to normal practice.
PB1DH-A1
This drilling is executed with just a jet bit. A pill test is conducted at the end before the stop test. The stop test is
executed with a duration of approximately 3.5 days after reaching the end at 1000m and a depth of NAP -65m.
The stop test caused no problems at startup afterwards.
A model often used to describe the rheology of the drilling fluid in HDD is the Bingham Plastic Model (Baumert
et al., 2005), which can be written in the following way:
τ = τy + µ ∗ γ (5.1)
23
24 5. Processes
The Power Law rheological model assumes no yield stress and as such the shear stress is defined by:
τ = K (γ)n (5.2)
Where K is the flow consistency index [P a.s n ] and n is the flow index [−]. But while the model is sufficient with
high shear rates it is not as accurate for low shear rates (Hemphill et al., 1993) as cited in (Baumert et al., 2005).
The Hershel-Bulkley or yield-power law model, is a modified version of the Power Law rheological model and
is defined by:
τ = τ y + K (γ)n (5.3)
Most drilling fluids show behavior that can not be accurately described by the Bingham model for fluids. While
the model is sufficiently accurate in the higher shear rate range (300-600 rpm) it is often inaccurate in the lower
shear rate ranges, see figure 5.1, which are of interest for laminar, annular flow behavior (Baumert et al., 2005).
The actual shear rate can be a criterion on which a selection is made between the mentioned fluid models. The
average shear rate in an annulus can be calculated using the following formula from (Denekamp et al., 2000).
8 ∗ vr f
γr f = R f ac ∗ (5.4)
DB H
where: γr f = the average shear rate of the return flow in [1/s]
R f ac = a factor for the hydrauluc radius, which is 1.5 for an annulus
v r f = the average velocity in [m/s]
D B H = the diameter of the borehole in [m]
Another formula for the average shear rate in an annulus is (Mendes and Naccache, 2005):
vr f
γr f = (5.5)
(Ro − Ri )
Where Ro is the radius of the borehole in [m] and Ri is the radius of the Drillstring (DS) in [m].
where: RO 600RP M = the value of the viscometer at 600 Rotations Per Minute (RPM) [◦ ]
RO 300RP M = the value of the viscometer at 300 RPM [◦ ]
CF1 = a conversion factor used for converting the readout value from [◦ ] to [mPa]
CF2 = a conversion factor used for converting the setting of the device to shear rate, [-] to [1/s]
CF1 and (600 − 300) ∗C F 2 are roughly the same value, respectively 511 and 510, so just RO 600RP M − RO 300RP M
could be used without causing a large deviation. The Y P is calculated as follows:
The Klotz and Brigham Method (Klotz and Brigham, 1998) that uses w i as a weighting factor to account for
the fact that the data gained at high speeds is more precise and reliable than the low-speed data. This method is
meant to be used on data acquired with a 6-speed viscometer. The speeds are 3, 6, 100, 200, 300 and 600 RPM,
which have to be multiplied by 1.703 to get the corresponding shear rate.
5.2. Different Fluid Models 25
( )
6 £ 6 £ 6 6 £
w i log γ̇i w i log τi ,d at a − τ y − w i w i log γ̇i log τi ,d at a − τ y
X ¡ ¢¤ X ¡ ¢¤ X X ¡ ¢ ¡ ¢¤
n= ÷
1 1 1 1
( )2 (5.8)
6 £ 6 6 £ ¡ ¢¤2
w i log γ̇i − w i w i log γ̇i
X ¡ ¢¤ X X
1 1 1
And P6 £
w i log τi ,d at a − τ y − n 61 w i log γ̇i
¡ ¢¤ P £ ¡ ¢¤
1
log (K ) = P6 (5.9)
1 (w i )
= a weighting factor τi − τ y
¡ ¢
where: w i
γ̇i = the shear rate [1/s]
τi ,d at a = the shear stress at the shear rate [P a]
τ y is, in this case an initial estimation of the yield stress which through iteration is changed till an acceptable
value is found for ∆ which is used as a measurement of error and is given by:
6 ¡ ¢2
∆= τi ,d at a − τi ,c al c
X
(5.10)
1
The Log Method is a more fundamental method, which is based on rewriting the basic HB model formula,
(Denekamp et al., 2000; Huisman, 1999). When assuming τ y = ψ∗τ3r pm , where ψ is a scaling factor, formula 5.3
can be rewritten to:
¡ ¢n
τ − τy = K γ
(5.11)
log(τ − τ y ) = log(K ) + n log(γ)
Plotting log(τ − τ y ) versus log(γ) results in a linear graph in which log(K ) is given by the intersection between
the graph and the y-axis and n is the slope or gradient of the graph. By varying the ψ -value the parameters can
be fine tuned to find the solution with the smallest deviation from the measured data. Based on experience the
value for ψ often is between 0.8 - 0.9 or 80 - 90% of the τ3r pm (Denekamp et al., 2000).
Table 5.1: A table comparing the results and accuracy of different fluid models as well as two methods of acquiring the HB
parameters, the data from mud model 3 from (Klotz and Brigham, 1998) is used.
RPM Dial Reading Klotz and Brigham Log Method Log Method, Scaled
Method (ψ=0.8)
3 14 τy 6.46 τ y = τ3r pm 7.15 τ y = ψ ∗ τ3r pm 5.72
6 16 n 0.552 n 0.686 n 0.522
100 30 K 0.534 K 0.217 K 0.661
200 38 ∆ 1.173 ∆ 4.278 ∆ 0.356
300 44 Bingham Power Law
600 60 YP 14.305 n 0.261
PV 0.016 K 4.454
∆ 94.997 ∆ 105.670
Figure 5.1: Graph based on table 5.1. Showing different models to describe fluid behavior.
5.3. Flow of Drilling Fluids 27
The pressure loss for Bingham fluids can be calculated using the following formulas, where the e f ac t or corrects
for possible eccentricity of the DS, see figure 5.2:
" #
47.88(PV ∗ v r f ) 6∗Y P
d P /d L = 2
+ ∗ e f ac t or
D B H − OD DS (D B H − OD DS )
(5.13)
δ
e f act or =
Ro − Ri
Figure 5.2: An example of a way to describe the geometry of a borehole with an eccentric DS (Baumert et al., 2005).
The following parameters are defined as characteristic for the flow behavior for a Bingham fluid (Bisschop,
1995):
The Reynolds number for Bingham fluids, which is defined as follows:
ρr f D B H vr f
Re = (5.14)
µ
Where Re is the Reynolds number and ρ r f is the fluid density. In general if Re ≤ 2000 the flow is laminar. A
generalized formula for the Reynolds number (Madlener et al., 2009), which can be applied to different fluid
models is defined as follows:
ρ r f ∗ v r2−n
f
∗ D Bn H
Re g en, f ul l = ´n
τy ¢n D B H n−1
³
∗ DvB H + K ∗ 3m+1 ∗ 8n−1 + µ∞ 3m+1
¡
8 rf 4m 4m ∗ v rf (5.15)
n ∗ K ∗ (8 ∗ v r f /D B H )n + µ∞ ∗ (8 ∗ v r f /D B H )
m=
τ y + K ∗ (8 ∗ v r f /D B H )n + µ∞ ∗ (8 ∗ v r f /D B H )
28 5. Processes
This is based on the viscosity law for an extended version of the HB model, that adds an µ∞ as a term for the
constant viscosity at very high shear rates. The viscosity law for the BH model and the law for the HB model are
different and the formula can be reduced accordingly. The viscosity law for the BH model is:
τy
K = 0, n = 1 → µ = + µ∞ (5.16)
γ
Where µ∞ is constant in the BH model and is equal to the plastic viscosity, PV . The viscosity law for the HB
model is:
τy
µ∞ = 0 → µ = + K γn−1 (5.17)
γ
ρ r f τ y D B2 H
He = (5.18)
µ2
The settling velocity, can be determined in a number of ways. In order for settling to occur, the grain has to
surpass the yield stress. The maximum grain diameter, d , before the yield stress is exceeded can be found using
multiple formulas, according to (Wan and Wang, 1994) as cited in (Bisschop, 1995):
16.5τ y
d= (5.19)
g (ρ s − ρ r f )
Where ρ s is the grain density. Both equation 5.19 and equation 5.20 can be rewritten and are examples of a
criterion originating in the plasticity theory:
τ y ≤ a cr (ρ s − ρ r f )g d (5.21)
Where acr is in a range between 0.048 - 0.200 according to the results in a literature study by (Chhabra, 1993)
as cited in (Talmon and Huisman, 2005). For Bingham fluids the following formula can be used to calculate the
settling velocity (Wan, 1985) as cited in (Bisschop, 1995):
(ρ s − ρ r f )g d 2 7d τ y
v set t l e = − (5.22)
18µ 24µ
This formula is similar to the Stokes equation only contains an additional term. Other formulas found for the
settling speed in a Bingham fluid are often variations on the Stokes formula for laminar flow, for example the
formula for moderate inertial effects presented by (Prashant and Derksen, 2011):
(ρ s − ρ r f )g d 2
v set t l e = p (5.23)
18µ(1 + Re/9.06)2
The settling velocity as found in (Talmon and Huisman, 2005) has a slightly different form:
2
1 (ρ s − ρ r f )g d
v set t l e = α (5.25)
18 µ
5.3. Flow of Drilling Fluids 29
where:
τy
µ= + K (γ̇)n−1 (5.26)
γ̇
And α is an empirical coefficient to be determined from laboratory tests, in the paper α = 0.5 is used. The
similarities with earlier formulas are remarkable since (Talmon and Huisman, 2005) consider a Herschel-Bulkley
model instead of Bingham Plastic.
The ratio between yield stress and shear stress due to friction, which is defined as follows:
τy
ξ= (5.27)
τw
Where τw is the shear stress due to friction, which is calculated using:
f
τw = ρ r f v r2 f (5.28)
2
Where f is the Fannings-friction coefficient. Equation 5.27 can be used, for laminar flow, to determine the size
of the plug, for turbulent flow it is assumed that no plug flow occurs.
The Plasticity number, defined as the ratio between Hedstrom and Reynolds:
He 8ξ
PB = = (5.29)
Re 1 − 3 ξ + 31 ξ
4
5.4. Transport
Different approaches exist to model the transport processes and the amount of transport processes identified. An
extensive one by (Peden et al., 1990) presents a summary of earlier research:
• Homogeneous Suspension; sand is transported in suspension and distributed uniformly over the annular
space.
• Heterogeneous Suspension, sand is transported in suspension but there is a concentration gradient across
the annulus with more sand in the lower half of the annular space.
• Suspension/Saltation or Saltation/Suspension; sand is still transported in suspension but it is densely
populated near the low-side wall so that it is virtually transported by jumping forward or saltating on the
surface of the low-side wall. If suspension is dominant, this category is termed "Suspension/ Saltation"
and vice versa.
• Sand Clusters; sand is transported in suspension, but is is transported in clusters and all of the sand within
each cluster is traveling with roughly the same velocity.
• Separated Moving Beds (Dunes); separated sand beds are formed on the low-side wall of the annulus.
The sand on the surface travels forward while the sand on the inside of the bed remains stationary, so that
the beds look like they are rolling or sliding forward as a whole.
• Continuous Moving Bed; a thin, continuous sand bed is formed on the low-side wall of the annulus with
the sand near the low side wall rolling or sliding forwards at a lower velocity than that above the bed.
• Stationary Bed; a continuous sand bed is formed on the low-side wall of the annulus with the sand on the
surface of the bed rolling or sliding forward while the sand inside the bed is stationary.
The modeling of cuttings transport is extremely complex and no simple correlations exist for HB fluids (Bern
et al., 2007). Methods recommended to the API with regard to transport in vertical and high-angle wells are
based on Bingham fluids (Bern et al., 2007). For Bingham fluids 4 transport processes are identified (Bisschop,
1995):
• ‘No’ transport; grains are too big or the flow velocity is too low thus no transport occurs, this is referred
to as ‘Flow with stationary bed’ in Figure 5.3a.
• Transport through occurrence of plug-flow.
• Bed transport; transport along the bottom, also called saltation, see Figure 5.3b. The grains have a lower
velocity than the drilling fluid.
• Suspension transport; grains are small enough or the flow velocity and the viscosity are high enough, the
grains are transported as fast as the flow and the grains are evenly divided in the vertical direction, this is
referred to as ‘Flow as homogeneous suspension’ in Figure 5.3a.
5.4. Transport 31
(a) Different transport processes, (Vanoni, 1977) as (b) The saltation process, (van Rijn, 1987) as cited in
cited in (Bisschop, 1995). (Bisschop, 1995).
Plugflow
In a moving fluid, with a yield stress, plug flow is assumed to occur. In figure 5.4a the geometry of plug flow is
shown. An equation is given in (Kelessidis et al., 2006) for the τ y as depicted in the figure. This formula can be
rewritten to a function for the plug flow radius as follows:
rp d P
τy =
2 dL
(5.32)
dL
r p = 2τ y
dP
Where r p is the radius of the plug flow.
For plugflow the transport capacity is relatively easy to calculate, with the following formula (Bisschop, 1995):
Φ T p = ξ2 c v (5.33)
where: ΦT p = the transport capacity
ξ = the part where plug flow occurs
c v = the grain concentration
(a) The geometry of plug flow, in a pipe (b) The geometry of plug flow, in a concentric
(Kelessidis et al., 2006). annulus (Kelessidis et al., 2006).
Bed transport
For the transport in bed transport the formula’s by (Graf, 1984) as cited in (Bisschop, 1995) can be used:
ΦT b = 10.39ψ−2.52
T (5.34)
where:
(ρ s − ρ r f )d
ψT = (5.35)
ρ r f SR h
where:
τw
θcr = (5.38)
(ρ s − ρ r f )g d
and:
ρ b (ρ s − ρ r f )g
µ ¶1/3
d∗ = d (5.39)
µ2
However the resulting mode of transportation is bed transport, which has a high chance of sand accumulation.
The ideal mode is suspension transport. The following formula, derived in (Hanks, 1980) as cited in (Bisschop,
1995) can be used to calculate the velocity required for suspension transport:
ρ s − ρ r f 1/2 d 0.23
· µ ¶¸ µ ¶
v cr = 1.32c v0.186 2g D (5.40)
ρr f D
An upper limit with regards to concentration, c v , is not presented, although 0.15 - 0.2 is assumed as a safe value.
Since v cr is the lower boundary the left part could be rewritten to v ≥ .... Rewriting that equation results in a
formula for the maximum diameter of a grain for suspension transport based on the fluid velocity.
h ³ ρ −ρ ´i−1/2 1/0.23
s rf
v r f ∗ 2g D B H ρ
rf
d ≤ DB H ∗ (5.41)
1.32c v0.186
Suspension transport
All of the dug soil is transported if the condition of equation 5.40 is fulfilled.
5.5. Lag Time or Source Location 33
3 ∗ τy
D 90 = (5.43)
(ρ s − ρ r f ) ∗ g ∗ Y g
which can be used to calculate the maximum diameter that the fluid can transport based on a certain value for the
transport parameter.
Within the scope of this research and the data gathered it is decided not to go into more detail with regards to the
transport processes.
The approach also divides the geometry into three parts: vertical, inclined and horizontal. The vertical part is not
discussed in this research since it is not applicable to this project. In equation 5.44 the formulas for the inclined
part are presented.
VT (I ncl .) L I Si n(αV )
S D X (I ncl .) =
VT (I ncl .) + ROP
(5.44)
VT (I ncl .) L I C os(αV )
S DY (I ncl .) =
VT (I ncl .) + ROP
In equation 5.45 the formulas for the horizontal part can be found.
VT (Hor.) L H
S D X (Hor.) = (5.45)
VT (Hor.) + ROP
where: S D X (Hor.) = is the x-coordinate on the horizontal part of the boring
VT (Hor.) = is the cuttings traveling speed
LH = is the length of the horizontal part
S DY (Hor.) = is constant
Figure 5.5: An example of a lag diagram, relating the current location of the drill head to the location of the source of the
cuttings, (Garcia-Hernandez et al., 2008). ROP is the drill velocity, VT is velocity of the cuttings and VL is the
fluid velocity.
6
Methodology
In this chapter the methodology of the performed tests is elaborated on. As briefly mentioned in chapter 1 a goal
of this thesis is to investigate if it is possible to connect the spoils of the return flow to a location in the ground.
This is divided into two parts. The methodology of the actual data acquisition and tests performed on samples
from the return fluid is presented first in a section on Equipment and tests. Secondly the programs that connect
the samples to a source location are presented. These programs are explained further on in separate sections in
more detail:
• SampleSource Program, main program, does the calculations.
• MarsdiepVisual Program, creates graphs for visualization of the measurements and the results of the main
program.
• Fixes Program, deals with inconsistencies in the data and makes figures for the report that are not depended
on samples and scenarios, eg. figure 6.1a.
Table 6.1: A brief overview of the equipment used and the reason why it is used.
Equipment Motivation
Marsh Funnel To get and indication of the viscosity.
Viscometer or Rheometer A six-speed viscometer, to determine the rheological properties.
Mud Balance Determine the density of both inflow and return flow.
Electical Conductivity Meter To get the electrical conductivity, for example an increase in salt content
influences the rheological properties of the drilling fluid.
Sand Content Kit Determine the sand content of the return flow.
Sieve Test (On Site) To get an indication of the returns and to get clean fluid for the rheology
test.
Sieve Test (Laboratory) To determine the coarseness of the returns.
pH meter To get the pH, for example a decrease in pH is often an indication for
the presence of peat.
An adapted sieve test is performed on site, the test is adapted to the limits of the location and the available time.
The test conducted to check visually for changes in the soil and the sieved fluid, is used in determining the
rheology. Sieved fluid is required since the presence of grains can cause additional friction, distorting the results
of the test and cause damage the viscometer. A standardized sieve test is conducted in the laboratory in Delft to
determine the grain size distribution and to identify the formation of the samples.
35
36 6. Methodology
A concise flowchart of the program can be found in figure 6.2. The full code can be found in appendix E.
Example Calculation
In figure 6.1a a schematic, simplified version is depicted of the Intersection Method with two different diameters
but the same amount of pumped fluids. In figure 6.1b the drill head and fluid head locations are plotted.
At T − 0 the sample is taken and the location of the drill head and the location of the sample are known. At
T −1 the drill head is one pipe less far in the ground. The amount of fluid that is pumped down between T −0 and
T − 1 is calculated and divided by a cross-sectional area of the bored hole. The resulting length is the distance
that the fluid head traveled in this time. Continuing to do this results for the case of Diameter 1 in an exact match
at T − 2. At this point the fluid and the drill head are at the same location, which is expected to be the source
location of the sample.
Since diameter 2 is larger and the fluid rate is the same the distance the fluid head moves within the same time
interval is less. This means, in this case, that the transport time is increased and the distance from the surface to
the source location is decreased. It is also not an exact match.
In table 6.2 the values of the variables that are used in the figure 6.1a is presented.
Diameter 1 Diameter 2
Cross-Sectional Area 1 2 m2
Length Borehole 8 m
Drill Rate 1 m/T
Pump Rate 3 m 3 /T
Fluid Head Rate 3 1.5 m/T
As is presented at T-2 the fluid head for diameter 1 and the drill head are located at the same location. Logically
this is the source location of the sample taken. For diameter 2 there is not an exact match. After interpretation it
can be found that at around 5.8m the locations are the same.
6.2. SampleSource Program 37
Complications
There are a number of factors that complicate the method as it is described above. The most important ones are
listed below with a description and how they are handled.
Diameter
The diameter of the bored hole is unknown and although it can be estimated, it is likely highly variable due to
amongst others the variation in the soil, pump rates or progress rate. Due to the scope of this thesis different
diameters are looked at but it is assumed to be the same over the whole length of the borehole, see the next
section. It is however recommended that for further research the influence of diameter on transport processes is
taken into account.
Fluid loss
Unfortunately the fluid loss is also unknown. Despite the measurements taken on site the uncertainties remain
significant. To handle this problem 3 different losses are considered. In reality this parameter will also be location
dependent and it is recommended that it is further investigated to determine its influence. Furthermore, in Den
Helder there is a loss of about 5m 3 in the casing, every night which means that probably the mud cake of a certain
layer relatively close to the surface is not impermeable. For Texel the level of the drilling fluid in the casing is
not checked and reported on, so it is unknown whether a loss occurred during breaks.
6.2.2. Scenarios
In order to deal with the uncertainties with regards to the source location stemming from the uncertainties with re-
gards to the method of transportation and the losses, different scenarios are taken into account. For two variables
three options are investigated to get a range of values and thus to get an idea of the magnitude of uncertainty:
• Loss of drilling fluid; the values are the same for both sites.
– 0%; no loss this is a theoretical upper limit for the volume of the return flow.
– 7%; this value is based on the in- and outflow measurements taken on site. This is an average value
of the overall difference between the cumulative in- and outflow, which are only available for Den
Helder. An attempt is made to reconstruct it for Texel but due to different sources the resulting loss
is negative and thus unrealistic.
38 6. Methodology
– 30%; this is an assumption taken from the contractors and is used as an initial conservative value,
this is used as the lower limit for the volume of the return flow.
• Borehole Diameter; the values are different for both sites. The borehole diameter is related to transport
time since when the diameter goes up the velocity goes down and thus the transport time goes up as well,
which means that the source location becomes closer to the surface.
– 1.1 ∗ D Dr i l l , this is an assumption based on the minimum a drill head removes when passing through
the ground. When it rotates or pauses for moment the diameter will already be bigger. This is a
conservative value and as such the velocities in the borehole are likely to be lower and thus the
transport time longer.
– 0.45m, this is the result from tests conducted with a thicker fluid, a pill, in Den Helder. Such a test is
only done in Den Helder so for Texel 0.4m is assumed since the equipment used in Texel is smaller
than in Den Helder.
– 0.8m, for Den Helder and 0.55m, for Texel. These diameters are based on calculations of the diameter
derived from the measured sand content (Nugroho et al., 2016).
39
40 6. Methodology
• ProData file fix: in Texel multiple pumps are present and for a short while a pump is attached that had the
sensors but those are not calibrated or connected so a gap in the mudflow data exists. The gap is filled
using data with a lower accuracy found in the driller logs.
• Gefs: this part reads the desired variables from all 69 gef files containing the sieve results and puts them
in a .csv file. Thus collecting all required information in one file for easier continuation and removing the
unnecessary variables.
• Intersection Method figure: this creates a figure that is used to clarify the Intersection Method, figure 6.1a.
• Fluid Model figure: this creates a figure, figure 5.1, that is used to compare the different fluid models and
the different methods of determining the parameters.
7
Measurements
In this chapter characteristic results of measurements conducted on the project site and in the laboratory tests are
presented.
45
46 7. Measurements
Figure 7.1: A screen capture of the data supplied by the ProData system.
Figure 7.3: A screen capture of the survey data from Den Helder.
48
7. Measurements
Figure 7.4: The drilled paths in Texel.
7.1. Supplied Data
49
Figure 7.5: The drilled paths in Den Helder.
50 7. Measurements
Figure 7.7: A screen capture of the driller log from Den Helder.
7.2.1. On site
Here the results are presented of the tests conducted in the on site laboratory in Texel and Den Helder. This will
mainly consist of the results of the rheological tests. A screen capture of a part of the data is shown in figure 7.9.
Results of the sieve test performed on site is presented in figure 7.8. A description of this sample can be found
in table 7.1. Additional observations are that the 0.6mm sieve contained less than the previous sample and that
the 0.212mm and 0.063mm contained less silt-sized grains that had to be washed away after sieving since the silt
grains blocked the flow through the 0.212mm and 0.063mm sieves.
Table 7.1: Descriptions of the sieve results depicted in figure 7.8. The quantity is based on how much of the sieve, area wise,
could be covered with the quantity that is present on the sieve. The sample in the table is PB1DH-A3-85-69.
Figure 7.8: An example of the results from the sieve test conducted on site. The sample in the figure is PB1DH-A3-85-69.
52 7. Measurements
Figure 7.9: A screen capture of data gathered in Texel and Den Helder. This example comes from the Den Helder NAP-65m
drilling. The unit of the viscometer values is degrees.
7.2. Acquired Data 53
Figure 7.10: An example of a report constructed for every sample. The sample in the report is PB1DH-A3-85-69.
8
Interpretation
In this chapter the interpretation and correlation of the measurements and data as described in the previous
chapters as well as the results of the programs are presented.
Table 8.1: Fluid model fits to the experimental data for both sites.
For Texel BH is the best fit for about 81% of the cases. The use of one model and that model being BH for
all samples from Texel may be a logical choice. For Den Helder, where a different drilling fluid is used (see
subsection 4.2.2 and subsection 4.2.3) BH is in about 46% of the cases the best fit, against 54% for the HB
model. Which model is the best fit for the fluid samples from Den Helder, is unclear.
The variable behavior of the fluid in both sites makes it difficult to incorporate the behavior of the fluid in
the calculations and makes most of the preliminary calculations less reliable. For example the value for the yield
stress, for which a minimum value is prescribed, is higher when calculated according to the BH model than when
calculated according to the HB model. An extreme example is presented in figure 8.1a. For most samples the
results are similar to those displayed in figure 8.1b. For samples taken in Texel the HB model’s yield stress is
between 48 and 97 % of the BH model’s yield point. For samples taken in Den Helder the range is larger. The
HB value is between 11 and 90 % of the BH value. In figure 8.2 the variations of the yield point are presented.
The line in both figure 8.2a and 8.2b is based on the yield stress of the models with the best fit.
Predictions or prescribed requirements may end up being invalid or unattainable since the ratios between
different properties vary from fluid model to fluid model. For example the ratio between viscosity and yield
55
56 8. Interpretation
point is different for the0 drilling fluid in Texel and the drilling fluid in Den Helder. The same carrying capacity
requires less annular pressure in Den Helder, so the risk of fracturing the soil or causing a blow out is lower.
(a) A plot of the yield stress for both the Bingham and Herschel-Bulkley model in Texel. The orange line indicates the yield
stress of the model that is closest to the measured data.
(b) A plot of the yield stress for both the Bingham and Herschel-Bulkley model in Den Helder. The orange line indicates the
yield stress of the model that is closest to the measured data.
Figure 8.2: The yield stresses of the fluid model with the best fit.
58 8. Interpretation
Weighting Factor
The formula used in calculating the fit (equation 5.10) has one disadvantage of particular interest for the purposes
of this research. It fails in providing information regarding the fit in the area that is of concern. That is why, in
this research, a weighting factor is added that is based on a calculated value for the shear rate. This is done to
account for the accuracy of the Bingham model at high shear rates, this can cause a wrong result of which fluid
model is most accurate at the shear rate regime in the borehole. In table 8.2 the result of shear rate calculations
is presented. The results are averaged per scenario.
Table 8.2: Shear rates in the annulus, averaged for every scenario. Method 1 is referring to equation 5.4 and method 2 to
equation 5.5. Both are used to calculate the shear rate in the borehole but the outcome is different.
As is presented in table 8.2 the shear rates are all low compared to the high shear rates (510 - 1020 1/s ) in
which the Bingham model is most accurate. When adding the weighting factor to formula 5.10 the formula for
calculation of the deviation between the calculated and measured shear stress becomes:
2
i ,d at a − τi ,c al c )
8 (τ
∆=
X
(8.1)
i (γi − γr f )2
In table 8.3 the results is presented for the deviation calculated taking the weighting factor into account. When
Table 8.3: Fluid model fits for both sites, taking a weighting factor into account as defined in formula 8.1.
taking a weighting factor into account for the samples from Texel the BH model is the best fit in about 65% of
the cases. The use of only one model and that model being BH may not be such a logical choice. When taking
a weighting factor into account for the samples from Den Helder the BH model is the best fit in about 33% of
the cases. Choosing only one model may, in this case, not be a logical choice. This seems like a significant
change compared to using no weighting factor but the amount of samples that changed is still small, therefore
more research is recommended. The same graphs as depicted in figure 8.2 is created for both weighting factor 1
and weighting factor 2. The difference is minimal due to the amount of data points. The graphs can be found in
appendix D.3.
It has to be mentioned that all the samples have been tested only once and it is not known how large the
variation is which may occur as a result of the measurement equipment and the differences in the mixture itself.
The measurement at 3 Rotations Per Minute (RPM) is the most uncertain due to the possibility of gel starting
8.1. Drilling Fluid 59
to form. Due to the low shear rate in the borehole the 3 RPM measurement becomes more significant when
applying the weighting factor.
Figure 8.3: The long-time behavior of a sample from the drilling fluid used in Den Helder. This behavior includes
swelling/shrinking and separation of phases. The red circle encloses the same crack in the fluid, containing gas
and widening till day 4.5 and decreasing in size afterwards.
60 8. Interpretation
8.2.3. Transport
For the transport parameter, Y g , equation 5.42, 2 and 4 are recommended as values to prevent accretion of sand
in the borehole. The formula can be rewritten to estimate the D 90 the fluid can transport without accretion given
the transport parameter is a certain value.
When the measured D 90 of the sample is lower than the calculated value, D C al c this means that the coarser
material is not present at the source location otherwise it would have been transported. The transport is sufficient
and this is most often the case.
In a few cases the D 90 of the sample is larger than the D C al c for transport. In these cases it is unknown
whether the transport capacity is sufficient since coarser material than calculated left the borehole and thus the
value for the transport parameter is actually higher than 2 or 4. But even coarser material could have been left in
the borehole, forming a bed. These cases are counted as insufficient transport capacity.
In table 8.4 a summary is presented of the results. The results is presented in appendix D.1.
Table 8.4: Summary of the results from calculations of the maximum diameter for transport. The calculations are executed for
both the Bingham (BH) and the Herschel-Bulkley (HB) fluid model.
In table 8.5 the D 90 of the samples taken from the vertical drillings during the initial SI are presented as well as
the D 90 from the samples taken from the return flow of the horizontal drilling. From this table it becomes clear
that a static bed is formed in the borehole since the D 90 of the vertical drilling is significantly higher than the
D 90 of the horizontal drillings for the same formation, which means that material remained in the borehole. For
example for the Peelo Formation the difference is about a factor 2. For the Urk and Appelscha Formation the
difference is significant as well. An exception is the D 90 of the Eem Formation on the Texel side. The D 90 of the
sample from the return flow is significantly higher than the D 90 of the samples from the vertical drilling. This
is due to the samples that are located at the bottom of the filled valley, as indicated by the results of the seismic
8.3. Sample Identification 61
survey. These are considerably coarser than the Eem Formation as encountered during the initial vertical drilling.
Table 8.5: The D 90 of the samples taken during the initial vertical SI and taken during the pilot drilling. When more samples
are tested the average is given. The bold figures indicate the cases where the D 90 of the samples taken during the
vertical drilling is larger than the D 90 of the samples taken during the pilot drilling.
The formation to which the samples belong are identified based on multiple factors such as coarseness, presence
of micas and colored sand. No conflicting indicators of formations are found within one sample and as such the
samples are identifiable as coming from one formation. This implicates that no (significant) mixing has occurred
in the borehole. This means that no separation based on grain size has taken place (besides settling of the coarsest
grains) or at least not on a recognizable scale but also that the drilling fluid did not cause significant wall erosion.
Another implication is that a moving bed reaching the surface is less likely than a static bed.
Combining this with the results of section 8.2 indicates that the fluid model is of significantly less influence in
this specific case than previously assumed. Since no significant mixing occurs plug flow is the likely mode of
transport. Depending on the size of the sheared portion of the fluid the velocity of the plug is close to the average
fluid velocity in the borehole. For this research this means that the source can be determined with accuracy
without taking a fluid model into account. The calculation related to the drilling fluid only prove that this is
possible and are not required to calculate the difference between the cuttings velocity and the fluid velocity.
Knowing what soil is encountered also provides more information regarding the risks identified in section 2.2.
None of the risks in table 2.2 are as significant as assumed. The valley fill does not consist of gravel and larger
rocks but of slightly coarser sand from the Eem formation. At larger depths the soil is not so coarse that the
return flow stop due to infiltration losses. The Pot Clay, although encountered in Texel, is briefly drilled through
without significant problems. Drilling PB1T-B in Texel was aborted amidst conflicting observations around the
border to valley fill 2, so what is encountered there remains unclear.
62 8. Interpretation
Table 8.6: The grouped samples and the formation identification of the groups.
In table 8.7 the results of the first and last samples from the first drilling in both Texel and Den Helder are
shown for scenario 1, 5 and 9. It illustrates that the difference between scenario 1 and 9 increases with the
bore hole length, but the specifics appear to be highly influenced by progress rate, frequency of data points and
pump rate. As a result for a few samples multiple scenarios lead to the same source location. Figure 8.5a and
figure 8.5b graphically show the results of the Intersection Method for different scenarios on samples from the
same drilling in Den Helder. Sample PB1DH-A3-85-02 is taken at the start of the drilling at NAP-85m depth and
PB1DH-A3-85-75 is taken near the end of the drilling at NAP-85m depth.
Table 8.7: Results from different scenarios for different samples from the same drilling in both Texel and Den Helder.
Location Sample Code Drill Location at Sampling Time [m] Scenario Source Location [m]
1 88.5
B-65-TXL-03 111.95 5 79.1
9 60.3
Texel
1 1657.7
B-65-TXL-80 1681.58 5 1648.2
9 1600.1
1 48.8
PB1DH-A3-85-02 63.15 5 39.3
9 29.9
Den Helder
1 1871.6
PB1DH-A3-85-75 1973.66 5 1794.4
9 1298.6
8.4. Source Location 65
(a) Sample PB1DH-A3-85-02, taken at the start of the Den Helder drilling at
NAP-85m.
(b) Sample PB1DH-A3-85-75, taken at the end of the Den Helder drilling at
NAP-85m.
Figure 8.5: Plots of the results of the 9 different scenarios for two samples taken at the start and the end of the NAP-85m
drilling in Den Helder.
66 8. Interpretation
Figure 8.6: The lag diagram, relating the current location of the drill head to the location of the source of the cuttings found at
the surface, constructed from the data gathered in Texel.
8.4. Source Location 67
Figure 8.7: The lag diagram, relating the current location of the drill head to the location of the source of the cuttings found at
the surface, constructed from the data gathered in Den Helder.
8.5. Cross-section
In this section the results of the calculations of the source location are plotted on the initial cross-section. Fig-
ure 8.9 to figure 8.17 show the outcomes for the different scenarios.
The identified samples enables both an improvement of the cross-section as well as a validation of the scenar-
ios. The validation is possible due to geological features that are known, for example from the vertical drillings
conducted onshore in the initial SIs or from the seismic survey.
Figure 8.9: The calculated source location of the samples, according to scenario 1, plotted on the initial cross-section. The
color indicates the formation as identified by geologist from TNO. The diameter is 1.1 ∗ D Dr i l l and the loss is 0%.
In figure 8.9 the situation as a result of scenario 1 is presented. The parameters used in calculating scenario 1
make this scenario unlikely more importantly the result is not consistent with the results of the seismic survey.
Therefore, scenario 1 is improbable.
8.5. Cross-section 69
Figure 8.10: The calculated source location of the samples, according to scenario 2, plotted on the initial cross-section. The
color indicates the formation as identified by geologist from TNO. The diameter is 1.1 ∗ D Dr i l l and the loss is
7%.
In figure 8.10 the situation as a result of scenario 2 is presented. The situation is possible but the parameters used
in calculating scenario 2 make it unlikely since the diameter of the borehole is probably larger. Furthermore the
results of the calculations contradict the results of the seismic survey.
Therefore, scenario 2 is improbable.
70 8. Interpretation
Figure 8.11: The calculated source location of the samples, according to scenario 3, plotted on the initial cross-section. The
color indicates the formation as identified by geologist from TNO. The diameter is 1.1 ∗ D Dr i l l and the loss is
30%.
In figure 8.11 the situation as a result of scenario 3 is presented. The situation is possible but the parameters
used in calculating scenario 3 make it unlikely since the loss is high and the borehole diameter is probably larger.
Furthermore the results of the calculations contradict the results of the seismic survey.
Therefore, scenario 3 is improbable.
8.5. Cross-section 71
Figure 8.12: The calculated source location of the samples, according to scenario 4, plotted on the initial cross-section. The
color indicates the formation as identified by geologist from TNO. The diameter is 0.4m for Texel, 0.45m for
Den Helder and the loss is 0%.
In figure 8.12 the situation as a result of scenario 4 is presented. This is a likely result as it is a close fit to
the seismic profile but the infiltration loss is 0 for this scenario, which makes it an unrealistic scenario. When
compared with the results of the previous scenarios it is presented that the results of the source calculations and
the results of the seismic survey are fitting better together.
Scenario 4 is improbable because of the assumed 0% loss for this scenario.
72 8. Interpretation
Figure 8.13: The calculated source location of the samples, according to scenario 5, plotted on the initial cross-section. The
color indicates the formation as identified by geologist from TNO. The diameter is 0.4m for Texel, 0.45m for
Den Helder and the loss is 7%.
In figure 8.13 the situation as a result of scenario 5 is presented. This is a close fit to the seismic profile and has
plausible parameter values. Some samples are not fitting to what is known but in general the fit is good. Scenario
5 is the most probable out of the 9 scenarios tested in this research.
This is however based on the assumption that one scenario is the best fit to reality for both locations. For
Texel the results can checked with both the results of the initial vertical drilling and the results of the seismic
survey at significant horizontal distance away from the starting point of the drilling. For the Den Helder side
there is no data to check the results at horizontal distance away from the start of the drilling. This means that
although scenario 5 is used as the best fit for both locations it is uncertain which one scenario is the best fit to
reality on the Den Helder side.
8.5. Cross-section 73
Figure 8.14: The calculated source location of the samples, according to scenario 6, plotted on the initial cross-section. The
color indicates the formation as identified by geologist from TNO. The diameter is 0.4m for Texel, 0.45m for
Den Helder and the loss is 30%.
In figure 8.14 the situation as a result of scenario 6 is presented. This is the first scenario in which at least one
result is unlikely without taking additional information into account. The yellow circle indicates a sample that
is close to another sample but belongs to a different formation. Horizontal distance between the two samples is
about 25m. It is however possible in this location due to the fact that there are two boreholes around that depth on
that location due to multiple attempts, as is presented in figure 4.2. The results of the seismic survey contradict
the calculated location of the Eem Formation at that point.
Scenario 6 is improbable because of the reasons mentioned above.
74 8. Interpretation
Figure 8.15: The calculated source location of the samples, according to scenario 7, plotted on the initial cross-section. The
color indicates the formation as identified by geologist from TNO. The diameter is 0.55m for Texel, 0.85m for
Den Helder and the loss is 0%.
In figure 8.15 it is presented that the results of scenario 7 are contradicting each other. Sample origins in between
samples identified as other formations are indicated by a red circle. Sample origins at places where there has not
been drilled are indicated by a blue circle. This results comes from a combination of factors, among others the
frequency of the gathered data. A dark blue circle indicates where based on the order in which the samples are
taken the origin should be. The situation in the yellow circle is possible due to two boreholes around that location
due to multiple attempts, it is however not likely to be true due to the seismic profile made in the initial SIs.
Scenario 7 results in an unrealistic outcome for the samples from Texel and Den Helder and the 0% loss of
drilling fluids is unlikely as well.
8.5. Cross-section 75
Figure 8.16: The calculated source location of the samples, according to scenario 8, plotted on the initial cross-section. The
color indicates the formation as identified by geologist from TNO. The diameter is 0.55m for Texel, 0.85m for
Den Helder and the loss is 7%.
In figure 8.16 it is presented that the number of samples at unrealistic positions is only increased in scenario 8
compared to scenario 7. The blue circle highlights samples that should be in the dark blue circle. The situation
indicated by the yellow circle is unlikely, due to the conducted seismic survey.
Scenario 8 results in an unrealistic outcome for the samples from Texel and Den Helder.
76 8. Interpretation
Figure 8.17: The calculated source location of the samples, according to scenario 9, plotted on the initial cross-section. The
color indicates the formation as identified by geologist from TNO. The diameter is 0.55m for Texel, 0.85m for
Den Helder and the loss is 30%.
In figure 8.17 it is presented that scenario 9 results in an unrealistic situation. The red circle highlights a sample
location between or beyond samples of another formation. In the blue circle samples are indicated that belong
in the dark blue circle, based on the order in which the samples are taken. The sample in the yellow circle is
unlikely to be from that location due to the information derived from the seismic profile.
When looking at the lag diagram of this scenario (figure 8.8) it becomes clear that the samples in the blue
circle are incorrectly located there. The points corresponding to those samples have a source location that is more
that the position of the drill head, this is physically impossible. The lag diagrams found in appendix D.4 show
the same erratic results for scenario 7 and 8.
Scenario 9 results in an unrealistic outcome for the samples from Texel and Den Helder and the 30% loss of
drilling fluids is unlikely as well.
8.6. Improved Cross-section 77
79
80 8. Interpretation
8.7. Summary
It is found that the behavior of the drilling fluid is difficult to describe with one fluid model. Which of the two
tested models varies from sample to sample. The flow is likely laminar as indicated by a value for the Reynolds
number of in all cases less than 50. The transport capacity is in most but not in all cases sufficient, this is indicated
by calculations as well as a comparison between the D 90 of samples from the vertical drillings and the D 90 of
samples from the return flow.
The cuttings velocity is assumed to be about the same as the average fluid velocity. This is indicated by the
calculations related to the fluid model and that no traces of significant mixing are found.
The risk identified in section 2.2 and table 2.2 are not as significant as previously assumed. In the valley
fill gravel and larger rocks layers are not found but instead a coarse sand from the Eem formation is found. At
larger depths the soil is not so coarse that the return flow stop due to infiltration losses. The Pot Clay, although
encountered in Texel, has been drilled through without significant problems despite its high strength.
In this research scenario 5 (Loss = 7% and the diameter of the borehole = 0.4 or 0.45, for respectively Texel
and Den Helder) is the most suitable, see table 8.8. This is due to the fit of the results to what is known, ie. the
results of the seimis curvey and the results of the initial vertical drillings. The arguments for this are however
mostly based on the samples from Texel. This is due to the seismic survey which intersects with the data from
Texel. It is however possible that the scenario with the best fit for the samples from Den Helder is another
scenario. Unfortunately there is nothing that the Den Helder samples, at distance, could be correlated with, so in
this research the same scenario is used for both Texel and Den Helder.
The lag diagrams created for this research, figure 8.6 till figure 8.8 and found in appendix D.4, can be taken
into account to study the reliability of the results. In the case that the samples are located out of order the
graphs become erratic with samples where the sample source is further than the drill head, which is physically
impossible. This is presented for scenario 7 and 8, both found in appendix D.4 and for scenario 9 the results are
erratic. In section 8.5 this is indicated in the figures by a blue circle.
Scenario Results
1 Inconsistent with previous results and unlikely scenario parameters.
2 Inconsistent with previous results and an unlikely scenario parameter.
3 Inconsistent with previous results and unlikely scenario parameters.
4 Consistent with previous results and an unlikely scenario parameter.
5 Most probable, consistent with previous results.
6 Inconsistent with previous results, improbable outcome and an unlikely scenario parameter.
7 Inconsistent with previous results, improbable and unrealistic outcomes and an unlikely scenario
parameter.
8 Inconsistent with previous results, improbable and unrealistic outcomes.
9 Inconsistent with previous results, improbable and unrealistic outcomes and an unlikely scenario
parameter.
9
Conclusions
This chapter presents the conclusions of this research. These are the main subjects:
• Drilling Fluid
• Source Location
• Cross-section
• Suitability of Horizontal Directional Drilling (HDD) for Site Investigation (SI).
Of the main subjects in this chapter; number 2 (Source Location), 3 (Cross-section) and 4 (Suitability of HDD
for SI) correspond to the 3 principal questions of this research defined in section 1.1. Main subject 1 (Drilling
Fluid) is required to investigate main subject 2 (Source Location) but it is not a question by itself.
81
82 9. Conclusions
(based on 5 samples from the return flow during the horizontal drilling). This is due to the fact that the horizontal
drilling, drilled through the bottom of the filled valley where much coarser material is found.
The influence of a bed in the borehole on the return flow and on the calculated origin locations of the samples
is not taken into account in this research.
It is found that the properties and the fluid model of the return flow are determined by the properties of the
inflow, the soil, the groundwater and time dependent processes.
9.3. Cross-section
The second goal of this research is to investigate whether it is possible to construct a cross-section based on the
results of the samples taken from the return flow. Construction of a cross-section is possible based on the samples
taken from the return flow of a HDD project. The samples are still identifiable after sieving, which reduces the
samples to grains of 0.063mm and larger. This means that no significant mixing of soil from different sources
has occurred in the borehole during transport. Therefore it is concluded that the effect of wall erosion is limited,
as this would add grains from the eroded formations along the borehole.
What does diminish the suitability of HDD as a SI technique is that in this research it is not possible to
connect the samples from the return flow to a source location in the subsurface without the results of additional
SIs to correlate the results. In order to improve the suitability additional measurements are required. When the
loss of drilling fluid and the diameter of the borehole are better known, HDD can be used separately as a SI to
determine the geology.
Among the additional data gathered for the Marsdiep project are detailed pump rates and pump times, part
of the data acquired by the Prodata system. Although these can be reconstructed from the driller logs, which are
part of a regular HDD project, it is less accurate that way and it is preferable that the data are acquired in as much
detail as possible.
10
Recommendations
This chapter presents recommendations for further research that needs to be conducted in order to improve
the accuracy of the source location determination and thereby the suitability of Horizontal Directional Drilling
(HDD) as a Site Investigation (SI) technique.
10.1.3. Processes
For this research two of the most uncertain parameters, loss and diameter, are assumed to be constant along
the length of the drilling. This is however not realistic and further research should be conducted for a better
understanding of the processes down hole into the influence of this location dependency and into what influences
the amount of variation .
Research in this direction is performed but focused on pipes (Rice et al., 2015a,b). However getting an
understanding of the interaction of the fluid flow with the Drillstring (DS) and optional bed would improve the
understanding of the processes and increase the accuracy of the predictions as well as the calculated origin of
samples taken from the return flow.
85
86 10. Recommendations
• Data; some data are gathered at an insufficient frequency at an unsuitable location, examples are drill head
location and return flow respectively. Additional data would improve the accuracy of the result without
improving the method.
• Location dependency; the uncertainties with regard to diameter and drilling fluid loss are solved by the
use of scenarios in this research. However these parameters are not the same along the borehole. Through
iteration of the process up and including constructing a cross-section the diameter and loss could be made
dependent on the location. Results of additional SIs are required for correlation.
• Determination of the grain velocity; this is done by implementation of the fluid and transport processes
occurring in the borehole. Some of these processes might require additional investigation into the occur-
rence and magnitude of influence. At present the source location is based on the fluid head location. It
is possible that the grains are transported at a slower rate than the fluid velocity. How much slower is
unknown but depended on among others the fluid and the transport processes (Garcia-Hernandez et al.,
2008).
10.3. Cross-section
By taking more data into account the cross-section can be significantly improved. These improvements might
not all be visible ones but the reliability of the cross-section can increase as well. For example in this research
the data gathered with respect to the torque and push/pull forces on the drilling rig are barely mentioned. When
taking those data into account a more refined geo-technical cross-section might be constructed. This can be done
by dividing the formation into geo-technical units with roughly the same properties based on the torque and
push/pull forces that are measured.
Figure 10.1: A flowchart of the site setup during the drilling in Den Helder.
For determination of the source of the sample fewer modifications to a regular project are required than described
above or depicted in figure 10.1. However additional SI (old or new) will be required to correlate the results and
find the most probable solution. To get the source of the samples through use of the Intersection Method, as
described in this research, the following data are required:
• Drill location
• Pump rate and when the pump is on
Both the drill location and the pump rate/ pump times are monitored and recorded during regular projects. Pump
time is often the same as drilling time, with the exclusion of additional pump time while no progress is made to
clean the borehole. The other required parameters can be varied till a solution is found that consistent with what
is known from additional SIs. Those parameters are diameter of the borehole and loss of drilling fluid.
Bibliography
Allouche, E. N., Ariaratnam, S. T., and Macleod, C. (2003). Software for Planning and Cost Control in Direc-
tional Drilling Projects. Journal of Construction Engineering and Management, ASCE 129(4):446–453.
API (2010). API RP 13D – RP for Rheology and Hydraulics of Oil-Well Drilling Fluids.
Arends, G. (1998). Trenchless Technology Research in the Netherlands. Tunnelling and Underground Space
Technology, 12(98):53–57.
Ariaratnam, S. T. (2001). Evaluation of the Annular Space Region in Horizontal Directional Drilling Installations.
Technical report, Arizon State University.
Ariaratnam, S. T., Harbin, B. C., and Stauber, R. L. (2007). Modeling of Annular Fluid Pressures in Horizontal
Boring. Tunnelling and Underground Space Technology, 22:610–619.
Baik, H. S., Abraham, D. M., and Gokhale, S. (2002). A Decision Support System for Horizontal Directional
Drilling. Tunnelling and Underground Space Technology, 18(03):99–109.
Bailey, W. and Weir, I. (1998). Investigation of Methods for Direct Rheological Model Parameter Estimation.
Journal of Petroleum Science & Engineering, 21:1–13.
Baumert, M. E., Allouche, E. N., and Moore, I. D. (2005). Drilling Fluid Considerations in Design of Engineered
Horizontal Directional Drilling Installations. International Journal of Geomechanics, 5(December):339–349.
Bern, P., Morton, K., Zamora, M., May, R., Moran, D., Hemphill, T., Robinson, L., Cooper, I., Shah, S., and
Flores, D. (2007). Modernization of the API Recommended Practice on Rheology and Hydraulics: Creating
Easy Access to Integrated Wellbore Fluids Engineering. SPE Drilling & Completion, 22(December 2005):21–
23.
Bueno, S. M. (2012). Horizontal Directional Drilling Guide - A Comprehensive Look at the North American
HDD Industry. Bernard P. Krzys.
Cheng, R.-C. and Wang, R.-H. (2008). A Three-Segment Hydraulic Model for Annular Cuttings Transport With
Foam in Horizontal Drilling. Journal of Hydrodynamics, Ser. B, 20(1):67–73.
Chhabra, R. (1993). Bubbles, Drops, and Particles in Non-Newtonian Fluids. CRC Press, Boca Raton.
de Mulder, E., Geluk, M., Ritsema, I., Westerhoff, W., and Wong, T. (2003). De Ondergrond van Nederland.
Wolters Noordhoff, Groningen/Houten.
Denekamp, H., Grashuis, A., Hergarden, H., Kuyper, H., Mastbergen, D., Stoelinga, J., and Visser, T. (2000).
Handboek Horizontaal gestuurd boren ( HDD ). Technical report, Multiple Companies.
Duan, M., Miska, S., Yu, M., Takach, N., Ahmed, R., and Zettner, C. (2008). Transport of Small Cuttings in
Extended-Reach Drilling. SPE Drilling & Completion, 23(August 2006):5–7.
Espinosa-Paredes, G., Salazar-Mendoza, R., and Cazarez-Candia, O. (2007). Averaging Model for Cuttings
Transport in Horizontal Wellbores. Journal of Petroleum Science and Engineering, 55:301–316.
89
90 Bibliography
Garcia-Hernandez, A., Miska, S. Z., Yu, M., Takach, N. E., and Zettner, C. (2008). Determination of Cuttings
Lag in Horizontal and Deviated Wells. JPT, Journal of Petroleum Technology, 60:56–58.
Gjerstad, K. and Time, R. (2014). Simplified Explicit Flow Equations for Herschel-Bulkley Fluids in Couette-
Poiseuille Flow — For Real-Time Surge and Swab Modeling in Drilling. SPE Journal.
Hanks, R. (1980). ASME Paper No. 80-PET-45. In ASME Energy Sources Technol. Conf.
Haq, B. U., Hardenbol, J., and Vail, P. R. (1987). Chronology of Fluctuating Sea Levels since the Triassic.
Science (New York, N.Y.), 235(4):1156–1167.
Hemphill, T., Campos, W., and Philehvari, A. (1993). Yield-power law model more accurately predicts mud
rheology. Oil & Gas Journal, 91(34):45 – 50.
ISO (2013). ISO 14688-1:2002 - Geotechnical investigation and testing – Identification and classification of soil
– Part 1: Identification and description. Technical report, ISO.
Kelessidis, V. and Bandelis, G. (2004). Flow Patterns and Minimum Suspension Velocity for Efficient Cuttings
Transport in Horizontal and Deviated Wells in Coiled-Tubing Drilling. SPE Drilling & Completion, 19(De-
cember).
Kelessidis, V. C., Maglione, R., Tsamantaki, C., and Aspirtakis, Y. (2006). Optimal determination of rheological
parameters for Herschel-Bulkley drilling fluids and impact on pressure drop, velocity profiles and penetration
rates during drilling. Journal of Petroleum Science and Engineering, 53(3-4):203–224.
Kruse, H. (2009). The Trenchless Technique Horizontal Directional Drilling - Soil Related Risks and Risk
Mitigation. In 4th Pipeline Technology Conference.
Madlener, K., Frey, B., and Ciezki, H. K. (2009). Generalized reynolds number for non-newtonian fluids.
Progress in Propulsion Physics, 1:237–250.
Mastbergen, D. and Aanen, L. (2003). Boorvloeistof indringingsproeven in zand en grind.pdf. Technical Re-
port 1, WL|Delft Hydraulics.
Mastbergen, D., Talmon, A., and Huisman, M. (1998). Druk en Transport in boorgang. Technical Report
december, WL|Delft Hydraulics.
Mendes, P. R. S. and Naccache, M. F. (2005). Dynamics of Fluid Substitution While Drilling and Completing
Long Horizontal-Section. In Latin American and Caribbean Petroleum Engineering Conference.
Mesdag, C., Diaferia, G., de Kleine, M., Hoogendoorn, B., Kruse, G., and van Heteren, S. (2014). Seismic
survey PWN Marsdiep. Technical report, Deltares.
Mesman, G., Dingerdis, I., and Beers, P. (2014). Breuk drinkwatertransportleiding naar Texel, zomer 2013.
H20-Online, page 10.
NEN 3651 (2012). NEN 3651 - Aanvullende eisen voor buisleidingen in of nabij belangrijke waterstaatswerken.
Nugroho, D., Kruse, H., and van Meerten, J. (2016). Interpretatie proefboringen Marsdiep PWN project 5551594.
Technical report, Deltares.
Nugroho, D. and van Meerten, J. (2015). Voorontwerp van de installatie van 4,5 km drinkwaterleiding onder
Marsdiep door middel van horizontaal gestuurde boring (HDD). Technical report, Deltares.
Ofei, T. N., Irawan, S., and Pao, W. (2014). Modelling of Pressure Drop and Cuttings Concentrations in Eccetric
Narrow Horizontal Wellbore with Rotating Drillpipe. Journal of Applied Sciences, 14(23).
Bibliography 91
Ozbayoglu, E. M., Miska, S. Z., Takach, N., and Reed, T. (2009). Sensitivity Analysis of Major Drilling Parame-
ters on Cuttings Transport during Drilling Highly-inclined Wells. Petroleum Science and Technology, 27(June
2015):122–133.
Peden, J., Ford, J., and Oyeneyin, M. (1990). Comprehensive Experimental Investigation of Drilled Cuttings
Transport in Inclined Wells Including the Effects of Rotation and Eccentricity. European Petroleum Confer-
ence.
Peeters, J., Busschers, F., Stouthamer, E., Bosch, J., Van den Berg, M., Wallinga, J., a.J. Versendaal, Bunnik,
F., and Middelkoop, H. (2016). Sedimentary architecture and chronostratigraphy of a late Quaternary incised-
valley fill: A case study of the late Middle and Late Pleistocene Rhine system in the Netherlands. Quaternary
Science Reviews, 131:211–236.
Pilehvari, A., Azar, J., and Shirazi, S. (1999). State-of-the-Art Cuttings Transport in Horizontal Wellbores. SPE
Drilling & Completion, 14(September).
Post, W. (2015). Beschrijving van HDD proefboringen voor PWN waterleiding Marsdiep. Technical report,
Deltares.
Prashant and Derksen, J. (2011). Direct simulations of spherical particle motion in Bingham liquids. Computers
and Chemical Engineering, 35(7):1200–1214.
Ramadan, A., Skalle, P., and Saasen, A. (2005). Application of a three-layer modeling approach for solids
transport in horizontal and inclined channels. Chemical Engineering Science, 60:2557–2570.
Rice, H., Fairweather, M., Peakall, J., Hunter, T., Mahmoud, B., and Biggs, S. (2015a). Measurement of particle
concentration in horizontal, multiphase pipe flow using acoustic methods: Limiting concentration and the
effect of attenuation. Chemical Engineering Science, 126:745–758.
Rice, H., Fairweather, M., Peakall, J., Hunter, T., Mahmoud, B., and Biggs, S. R. (2015b). Particle concentra-
tion measurement and flow regime identification in multiphase pipe flow using a generalised dual-frequency
inversion method. Procedia Engineering, 102:986–995.
Royal, a. C. D., Riggall, T. J., and Chapman, D. N. (2010). Analysis of steering in horizontal directional drilling
installations using down-hole motors. Tunnelling and Underground Space Technology, 25(6):754–765.
Slater, R. (1977). Engineering Plasticity: Theory and Application to Metal Forming Processes. London.
Sun, X., Wang, K., Yan, T., Shao, S., and Jiao, J. (2014). Effect of drillpipe rotation on cuttings transport
using computational fluid dynamics (CFD) in complex structure wells. Journal of Petroleum Exploration and
Production Technology, 4:255–261.
Talmon, A. and Huisman, M. (2005). Fall velocity of particles in shear flow of drilling fluids. Tunnelling and
Underground Space Technology, 20:193–201.
van Meerten, J. and Nugroho, D. (2015). Evaluatie Proefboringen Marsdiep PWN project 5551594 E. Technical
report, Deltares.
van Rijn, L. (1987). Mathematical Modelling of Morphological Processes in the case of Suspended Sediment
Transport.
van Rijn, L. (1993). Principles of Sediment Transport in Rivers, Estuaries and Coastal Seas.
Vanoni, V. (1977). "Sedimentation Engineering". Manuals and Reports on Eng. Practice, 54.
Wan, Z. (1985). Bed Material Movement in Hyperconcentrated Flow. Journal of Hydraulic Engineering,
111(6):987 – 1002.
92 Bibliography
Zayed, T. and Mahmoud, M. (2013). Data acquisition and factors impacting productivity of Horizontal Direc-
tional Drilling (HDD). Tunnelling and Underground Space Technology, 33:63–72.
Zhou, H., Fan, H., Ji, R., Yin, D., Zhai, Y., and Ye, Z. (2013). A Comprehensive Methodology of Calculating
Hydraulic Parameters in Real Time and the Monitoring System. In SPE/IADC Middle East Drilling Technology
Conference.
Appendices
93
Contents Appendices
A Geology Background 96
A.1 Grain Size . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 96
A.2 Formations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 96
A.2.1 Naaldwijk Formation (NA) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 97
A.2.2 Nieuwkoop Formation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 98
A.2.3 Boxtel Formation (BX) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 98
A.2.4 Kreftenheye Formation (KR) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99
A.2.5 Eem Formation (EE) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99
A.2.6 Drente Formation (DR) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99
A.2.7 Urk Formation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 100
A.2.8 Peelo Formation (PE). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 101
A.2.9 Formation of Appelscha (AP). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 101
A.2.10 Formation of Peize (PZ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 101
A.3 Pre-Existing Model. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 102
B Initial Site Investigations, Proposals and Calculations 103
B.1 Initial Site Investigation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 103
B.2 Drilling Proposals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 103
B.2.1 Texel - Proposed . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 104
B.2.2 Den Helder - Proposed . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 105
B.3 Boundary Conditions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 106
B.4 Parameters, Dimensions and Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 106
B.4.1 Geometry of the boring . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 106
B.4.2 Product pipe . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 106
B.4.3 Execution . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 106
B.4.4 Drilling fluid . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 107
B.4.5 Coefficient of friction. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 107
B.4.6 Other. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 107
B.5 Results . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 107
B.5.1 Minimal Drilling Fluid Pressure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 107
B.5.2 Torque and Normal Force. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 108
B.5.3 Rate Of Penetration (ROP) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 108
B.5.4 Infiltration and loss of drilling fluid . . . . . . . . . . . . . . . . . . . . . . . . . . . . 110
B.5.5 Transport Capacity . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 110
B.5.6 Height of Mound . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112
B.5.7 Casing Length . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112
B.5.8 Other. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112
C Equipment and Tests 113
C.1 Laboratory Equipment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 113
C.1.1 Marsh Funnel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 113
C.1.2 (Roto) Viscometer, (Fann) Rheometer . . . . . . . . . . . . . . . . . . . . . . . . . . 113
C.1.3 Mud Balance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 114
C.1.4 Electrical Conductivity Meter. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 114
C.1.5 Sand Content Kit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 114
C.1.6 Sievetest . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 115
C.1.7 pH Meter. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 116
C.2 HDD Equipment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 116
C.2.1 Mud Pulse . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 116
94
95
A.2. Formations
The different formations are described in chronological order, starting with the youngest.
The general paragraph of the descriptions is based on the Nomenclator from TNO.
The local occurrence paragraph is based on the descriptions of the inital drillings conducted for this project
as well as the sieve curves from samples gathered during the initial Site Investigations (SIs). The sieve curves
are created after the original descriptions and calculations are made and thus can result in a different description
of the soil. Tables with characteristic percentages can be found at the formations for which a sieve curve is
constructed. The characteristic percentages are based on those used in the preliminary calculations in order to be
able to make a comparison afterwards; D10, D15, D50 and D90.
The risk section is based on the risk matrix behind the Geobrain or Soilrisk website (Deltares, 2010), which
is based on the experience of a number of companies active in the underground in the Netherlands. The location
of the Marsdiep project is on the boundary between two areas for which the risks are classified and as such an
over prediction of the amount and severity of the risks may occur. The risks are subdivided into 9 ground related
risks and 3 risks related to groundwater. Only the most severe risks for Horizontal Directional Drilling (HDD)
are presented at the different formations in this thesis.
The parts will start with the name of the formation followed by, in brackets, the abbreviation used in figure 3.1
and the tables with the soil parameters in appendix ??. These tables are sorted on soil type so one table can contain
the parameters used for multiple formations.
96
A.2. Formations 97
Table A.2: Formation Descriptions, brief and in general, based on dutch formation descriptions (Nugroho and van Meerten,
2015).
Symbol Age & Formation Name Description of the soil type in the geological unit
Na Holocene: Naaldwijk Formation, Clay and locally peat, on silty sand with varying
layer set of Nieuwkoop grains size also inclusions of fine layers and shells;
locally fining upwards sequences, an indication of
gully filling
Bx Weichselien to Holocene: Boxtel Very fine to medium fine sand; silt and sandy units
Formation show results of cryoturbation
EE-BB Weichselien or Eemian: Eem For- Fine to medium fine sand with clay layers; layer-
mation Bruine Bank ing and the presence of thin fine coarsening up-
ward layers indicate a "low-energy" fluvial coast
environment.
Dr Saale Glaciation: Drente Formation Coarse and gravelly sand or boulder clay
EE-URTY Cromerien to Saale Glaciation: Urk Coarse, mostly gravelly sand, with local clay and
Formation, layer set of Tynje peat layers of limited spread and thickness in up-
per 10 meters of the unit (higher than NAP -50m);
high but varying conus-resistances with random
pattern indicate "high-energy" fluvial activity
Val_a Saale Glaciation or Eemian: Drente Coarse gravelly sand, in a complex or variable
Formation or Eem "valley fill", top part consists of fine to moderately
coarse sand
Val_b Saale Glaciation or Eemian: Drente Coarse gravelly sand, in a complex or variable
Formation or Eem "valley fill", with the possibility of a very coarse
gully filling at the bottom containing pebbles and
boulders present in a layer or as isolated blocks
higher in the "valley fill"
PENI Elster: Peelo Formation, layer set Strong (pot)clay
of Nieuwolda
PE Elster: Peelo Formation Medium fine sand with clay layers
URVE Cromerien to Saale Glaciation: Urk Medium to very coarse, generally gravelly sand;
Formation possibly fining upward toplayer (Elster)
AP, PZ Pliocene and early Pleistocene: Medium to very coarse, generally gravelly sand
Formation of Peize, Appelscha
Note: Some of the names of the ages correspond to glacial periods, these names are depending on
where they are identified as such, these names are different in different countries.
Local Occurrence
Within the borings the Naaldwijk Formation is identified in the Texel boring as a brown to gray, moderately fine,
weak to moderately silty sand, which can contain traces of iron oxide, traces of micas, shells, small clay layers
and traces of detritus at the bottom of the formation, which could indicate the transition to Nieuwkoop Formation.
In the Den Helder boring it is identified as a brown to gray, moderately fine, well sorted, weak silty sand, which
98 A. Geology Background
can contain traces of organic material, traces of micas, shells and clay as well as some peat and gyttja layers
are found towards the bottom of the formation, which could be Nieuwkoop Formation. The sieve curves can be
described in Texel as a weak silty fine to coarse sand with one sample containing gravel and in Den Helder as a
silty fine sand.
Risks
This formation can consist of a weak clay which may be active so chemically swelling can occur. The formation
can consist of fine sand which is susceptible to erosion by the drilling fluid. The formation is also deemed to
be unpredictably variable. At the bottom of the formation wood can be encountered and form obstacles. The
groundwater is salt, which may pose a risk for the properties of the drilling fluid but no further risks are identified
with relation to the groundwater.
Local Occurrence
The Nieuwkoop Formation is not distinguishable from the Naaldwijk Formation and is not identified separately.
However it is suspected to be found between the Naaldwijk Formation and the Boxtel Formation, identifiable
only by a slight increase in organic and clay content, in particular small detritus layers and small clay layers or
inclusions. No sieve tests are conducted on samples from this formation in the initial SIs.
Risks
For the most part this formation is reasonably safe considering risks due to obstacles but it can contain parts of
old oak trees and at the bottom the boundary is formed by the transition to sand layers. Going from weak to
strong(er) layers may pose a range of risks, for example deviations from alignment or sideways bending of the
Drillstring (DS) as a reaction on the strong layers at the front but weak layers on the sides. The groundwater is
salt, which may pose a risk for the properties of the drilling fluid but no further risks are identified with relation
to the groundwater. .
• Light yellow to dark brown, very fine to moderately coarse sand which is weak to strong silty and can be
calcareous.
• Light yellow to light gray, very fine to moderately fine, very silty sand, which can be calcareous.
• Grayish brown to dark gray, weak to strong sandy loam, which can also contain clay and organic parts, can
be calcareous.
This formation can be found on the surface in the south and eastern parts of the Netherlands, in the Northwest.
However this formation is covered by the Echteld Formation, Naaldwijk Formation or Nieuwkoop Formation.
The bottom boundary in the Northwest of the Netherlands is often the contact with the Eem Formation, which is
a sharp transition to calcareous sands with fossils.
Local Occurrence
In the Texel boring this formation is identified as a gray, very to moderately fine, moderately to very silty sand,
which can contain traces of organic material and small layers of peat and clay. In the Den Helder boring this
formation is identified as a light brownish gray, very fine, moderately sorted, slightly silty sand. The sieve curves
can be described as a silty fine sand.
A.2. Formations 99
Risks
In the parts of the formation consisting of eolian sands there is a major risk of softening while drilling and the
soil is susceptible for erosion by drilling fluid. The formation is highly unpredictable due to the presence of filled
river valleys and stones can be present towards the bottom of the formation. The groundwater is salt, which may
pose a risk for the properties of the drilling fluid and locally over pressured aquifers can be found, which can
cause seepage into the drilled borehole and local borehole instability.
Local Occurrence
This formation is not identified during the initial SI. The formation is however identified during the investigation
of the samples from the horizontal drilling as a brownish, colored sand. Slightly deviating from the standard
description of the Kreftenheye Formation but it matches the description for unit A3, identified as the Kreftenheye
formation (Peeters et al., 2016).
Risks
The formation can be locally weak and due to the coarseness highly permeable. The ground water is salt, which
may pose a risk for the properties of the drilling fluid and there is a low risk for over-pressured aquifers.
Local Occurrence
In the Texel boring this formation is identified as a gray to dark gray, well sorted sand, which can contain a few
detritus layers at the top of the formation, traces of colored material and clay layers. In the Den Helder boring
this formation is identified as a dark yellow to brownish gray, very sandy clay with micas or a brownish gray,
very to moderately fine, well sorted, slightly silty sand with traces of micas. The sieve tests reveal that the Bruine
Bank section is finer than the Eem formation and the samples indicate a weak silty to silty fine sand in Texel and
a very silty to silty fine sand in Den Helder for the Bruine Bank section. The curves from the Eem formation can
be described in Texel as a coarse sand and in Den Helder as a weak silty fine to coarse sand.
Risks
The formation is considered weak and the risk of softening of the sand is present. At the bottom of the formation
the permeability might be high. The groundwater is salt, which may pose a risk for the properties of the drilling
fluid and locally over pressured aquifers can be found, which can cause seepage into the drilled borehole and
local borehole instability.
In the western part of the Netherlands the top of this formation is formed by the Eem Formation. The transition
is gradual and can be determined by the presence of shells or when present by a diatomite or a gyttja layer at
the bottom of the Eem Formation. The Drente Formation is sharp and discordant deposited on older formations.
In this case the Urk Formation, which is recognizable as slightly more colored. If gravel is present this can be
used since the gravel in the Drente Formation has a glacial component, amongst others; flint, granite and more
crystalline, while the gravel in the Urk Formation doesn’t have this component.
Local Occurrence
This formation is identified as a gray, strong sandy clay, which can contain boulders on the Texel side and as a
sand which can contain boulders on the Den Helder side.
Risks
In this formation the permeability can be high and at the bottom of the formation obstacles might be encountered.
The groundwater is salt, which may pose a risk for the properties of the drilling fluid and locally over pressured
aquifers can be found, which can cause seepage into the drilled borehole and local borehole instability.
Local Occurrence
The Urk Formation - Tynje Section is on the Texel side described as a gray, moderately fine to very coarse, slightly
to very silty sand, with traces of colored material, shells, white quartz and organic material and a variation in
sorting. The Tynje section is on the Den Helder side described as light gray to gray, slightly silty moderately
coarse sand, with traces of organic material and shells and badly to moderately well sorted. In Den Helder the
Veenhuizen section is identified as well. The Veenhuizen section is described as a gray, weak silty moderately
fine to moderately coarse sand, with traces of colored material, pink grains, few black grains and well sorted. In
general it appears that the Urk Formation is more diverse in appearance on the southern, Den Helder, side of the
project. Sieve tests conducted on samples from this formation indicate that the Tynje section consists of a coarse
sand on the Texel side and a fine sand on the Den Helder side. The Urk formation is only tested on the Den
Helder side are the curve indicates a weak silty fine sand.
Risks
The formation properties can vary unpredictably and as such there is a risk of encountering weak zones and the
sudden transition to strong(er) zones as well. Both chemically and physical swelling of the clay present might
occur and obstacles might be present at the bottom of the formation for the Tynje section. Urk and the Tynje
section might be very permeable. The groundwater is salt, which may pose a risk for the properties of the drilling
fluid and locally over pressured aquifers can be found, which can cause seepage into the drilled borehole and
local borehole instability.
A.2. Formations 101
Local Occurrence
Both distinct types of this formation can be found in the drillings from Den Helder and Texel. The Nieuwolda
layers are described as dark to blackish gray, weak silty clay on the Den Helder boring and as a dark gray, very
strong clay containing some gravel in Texel. In Den Helder the Peelo formation is described as a gray to dark
gray, moderately to badly sorted, moderately coarse to very coarse sand, which can contain silt, gravel and traces
of white quarts. Sieve tests indicate a weak silty, weak gravelly, fine to coarse sand.
Risks
This formation has a high risk of physical swelling where potclay occurs and can locally have a high permeability
and the sand that is present is sensitive to softening. There is a risk of weak to strong transition zones due to the
possibility of pot clay being present. The groundwater is salt, which may pose a risk for the properties of the
drilling fluid but no further risks are identified with relation to the groundwater.
Local Occurrence
The Formation of Appelscha is only described on the Den Helder side since the drilling on the Texel side didn’t
reach the required depths. In this borehole it is described as a gray, moderately to very coarse, weak silty sand
with some shells and white quartz grains. Sieve tests indicate a weak silty, weak gravelly, fine to coarse sand.
Risks
This formation can be coarse and very permeable as well as highly variable. Obstacles might be present and the
groundwater is salt, which may pose a risk for the properties of the drilling fluid but no further risks are identified
with relation to the groundwater.
Local Occurrence
Based the borings the Formation of Peize is not well recognized at the project site, it is not found in the Texel
boring and with a remark that it also could be Formation of Appelscha in the Den Helder boring. It is described
as a light gray to gray, moderately to very coarse, weak silty sand. In the sieve tests it is presented as a coarse
sand.
Risks
This formation can be coarse and very permeable. Obstacles might be present and the groundwater is salt, which
may pose a risk for the properties of the drilling fluid and locally over pressured aquifers can be found, which
can cause seepage into the drilled borehole and local borehole instability.
Figure A.1: Cross-section made with GeoTOP, available through DINOloket.nl, based on a collection of subsurface data,
(TNO, 2013c), with Texel on the left and Den Helder on the right side.
B
Initial Site Investigations, Proposals and
Calculations
This appendix contains information about the initial Site Investigations (SIs), proposals and the most relevant
results of the preliminary calculations.
103
104 B. Initial Site Investigations, Proposals and Calculations
Figure B.1: Cross-section with the proposed alignments of the pilot drillings,generated in the program DGEOpipeline (Post,
2015).
• Scenario 1, both torque and tensile load are smaller than the 40% limit.
• Scenario 2, between the 40% and the 60% limit.
• Scenario 3, between the 60% and the 80% limit.
• Scenario 4, larger than the 80% limit.
Depending on the scenario the duration and start procedure are different. In general the drillbit would be
pulled back from the face before reducing the flow to 0 L/min. At the start the flow would be brought to 1500
L/min in about 15 minutes before rotation would start or the other way around depending on the scenario. In
all cases the torque would be measures while rotating at low speeds (5-10 Rotations Per Minute (RPM)) and no
flow. The method for pulling back is the same, once the torque is below a threshold value it would start, nine
pipes would be pulled while rotating but the tenth would be pulled statically.
B.2. Drilling Proposals 105
Figure B.2: A graph with the limits of both torque (kNm) on horizontal axis and tensile load (kN) on the vertical axis in black
dotted lines and different calculated cases in color.
PB1T-A
Due to the depth this boring will not be executed. The risk on fractures and blowouts would be to large. See
subsection B.5 in appendix B for more information.
PB1T-B
This is the first boring that is going to be executed. The length in total will be about 2500m and the depth of the
horizontal part will be about NAP-65m. This boring will encounter the "valley fill" which presumably consists of
coarse gravelly sand with possible occurrence of boulders as layers at the bottom of old filled trenches or isolated
higher on in the formation. If this boring doesn’t succeed after a few attempts, the next depth will be drilled.
PB1T-C1
This boring has a total length of about 1500m and the depth of the horizontal part will be about NAP-85m. It
is currently unsure whether the Pot Clay will be encountered. If the Pot Clay is present as a large, thick layer
beneath the valley fill, then after consultation and in agreement with PWN the next alignment, PB1T-C2, will be
executed.
PB1T-C2
This boring has a total length of about 1500m and the depth of the horizontal part will be about NAP-100m. This
boring will cut through the possibly present Pot Clay and end in the coarse gravelly sand formations (Formation
of Peize, Appelscha) from the Pliocene or Early Pleistocene.
During the first few hours the flow will be maintained at a lower volume (500L/min) while no progress is made,
in total the stop will last 2 days.
During the boring the effect of the Rate Of Penetration (ROP) shall be tested as well. In the horizontal part
at a certain lenght the ROP will be reduced from 3m/min to 1,5m/min, in order to investigate what the effect is
on the returnflow, pressures and borehole stability.
PB1DH-A1
This boring has a total length of about 1000m and the depth of the horizontal part will be about NAP-65m. It
ends in a layer consisting of mostly moderately fine sand, possibly loosely packed but coarse sand with clay
layers can be encountered as well (melt water deposits of the Peelo Formation).
PB1DH-A2
This boring has a total length of about 2000m and the depth of the horizontal part will be at a depth based on the
results of the borings on the Texel side of the Marsdiep.
• Dikes need to be crossed at a minimum depth of 10m (NEN 3651, 2012). By starting 100m away from the
dikes and at an angle of 12◦ , the crossing is at a depth of -21.3m relative to the starting height.
• The pressure in the borehole is not allowed to exceed the strength of the surrounding soil, in order to
prevent fracturing and blow-out.
• The overpressure during stand still is at least 15 kPa and preferable 20 kPa, to ensure hole stability.
B.4.3. Execution
For the execution two scenarios are taken into account, for both scenarios the meeting in the middle method will
be used due to the length of the allignment.
• Scenario 1; pilot boring with a drill bit of 311 mm or 12.25", reamer of 406mm or 16" and pull in afterward.
• Scenario 2; pilot boring with a drill bit of 406 mm or 16" and pull in afterwards.
The following specifications are used in the different phases of the project, see section 2.3 for more information.
B.5. Results 107
Pilot phase
• The diameter of the borehole is 331 mm (scenario 1) or 410 mm (scenario 2).
• The outer diameter of the drill string is 194 m or 7 5/8".
• The wall thickness of the drill string is 10.2 mm.
• Flow rate of return fluid is 2000 liter/m.
• Circulation loss is 30%.
• The ROP is 0.05 m/s or 3 m/min.
B.4.6. Other
• The volumetric weight of the sea water is 10.1 kN /m 3 .
• The average sea level is set on NAP+0m for the preliminary design.
• The dry density of the clay in the drilling fluid is 2650 kg /m 3 .
B.5. Results
In this section the results of the preliminary calculations can be found. Most of the calculations are made using
DGeoPipeline.
Table B.3: Summary of the calculations made for the drilling fluid pressures.
P mi n:pi > P mi n:pi > P mi n:r e > P mi n:r e > P mi n:pu > P mi n:pu >
Scenario Design Depth Pf r P max Pf r P max Pf r P max
1 NAP-45m Yes Yes Yes Yes Yes Yes
1 NAP-65m Yes No Yes No Yes No
1 NAP-100m No No No No No No
2 NAP-45m Yes No NA NA Yes No
2 NAP-65m No No NA NA No No
2 NAP-100m No No NA NA No No
P mi n is the minimum required drilling fluid pressure in pilot phase (pi), reaming phase (re) and pull
in phase (pu).
P f r is the maximum drilling fluid pressure before fracturing occurs.
P max is the maximum drilling fluid pressure before blowout occurs.
NA means Not Applicable, since there is no reaming phase in scenario 2.
Case Scenario Phase Tmi n [kNm] Tmax [kNm] Nmi n [kN] Nmax [kN]
Favorable 1 Pilot 60 70 900 1100
Favorable 1 Reaming 70 80 NA NA
Favorable 2 Pilot 60 70 1100 1300
Unfavorable 1 Pilot 80 90 1700 1900
Unfavorable 1 Reaming 90 100 NA NA
Unfavorable 2 Pilot 80 90 2250 2400
T for Torque, N for Normal or pressing force and NA for Not Applicable.
Table B.5: Changing fluid parameters at different penetration rates and flow rates. Scenario 1, pilot phase.
Table B.6: Changing fluid parameters at different penetration rates and flow rates. Scenario 1, reaming phase.
Table B.7: Changing fluid parameters at different penetration rates and flow rates. Scenario 2.
Table B.8: The drilling fluid loss, per layer in the pilot phase.
Table B.9: Drilling fluid loss, per layer in the reaming phase.
Table B.10: The maximum grain size for transport, yield stress = 11 Pa.
Table B.11: The maximum grainsize for transport, yield stress = 14 Pa.
Table B.12: Required mound height, with high water and an overpressure of 15 kPa.
Depth in the axis of the alignment [mNAP] Drilling fluid pressure Required drilling fluid
incl. overpressure [kPa] level [mNAP]
NAP-6m (bottom of casing) 81 + 1,73
NAP-23,5m 268 + 1,98
Drilling to NAP-45m: 485 + 1,16
Drilling to NAP-65m: 687 + 0,40
Drilling to NAP-100m: 1040 - 0,94
Table B.13: Required mound height, with high water and an overpressure of 20 kPa.
Depth in the axis of the allignment [mNAP] Drilling fluid pressure Required drilling fluid
incl. overpressure [kPa] level [mNAP]
NAP-6m (bottom of casing) 86 + 2,21
NAP-23,5m 272 + 2,45
Drilling to NAP-45m: 490 + 1,63
Drilling to NAP-65m: 692 + 0,87
Drilling to NAP-100m: 1045 - 0,46
The existing heights of the entry points are NAP+0.42m for Texel and NAP+4.15m for Den Helder. Comparing
the required and existing height it becomes clear that the entry site in Den Helder is sufficient while the entry
point in Texel requires an artificial mound to the height of NAP+2m or NAP+2.5m depending on the required
overpressure.
B.5.8. Other
In the report by Nugroho and van Meerten a number of other calculations are made as well, for example the
pulling force and the maneuverability. But since they’re not related to the topic of this thesis the calculations are
excluded.
C
Equipment and Tests
This appendix contains brief explanations and illustrations of the laboratory equipment that is used and the tests
that are performed. It contains a brief section on different Horizontal Directional Drilling (HDD) equipment as
well.
113
114 C. Equipment and Tests
(a) The Visco Meter used in Texel. (c) The Electrical Conductivity Meter used in Texel.
Figure C.1: The Visco Meter, Mud Balance and EC meter used in Texel.
C.1.6. Sievetest
There is not enough time in between taking samples in Texel to do a full sieve test, so an adapted version is
conducted to get an indication of ratio between different size-fractions. A liter of the drilling fluid is put in the
sieves, which are stacked from coarse to fine (5,6 mm, 2 mm, 1 mm, 0,6 mm, 0,355 mm, 0.212 mm and 0,063
mm). The vibrating table is turned on for 10-15 minutes. Afterwards the sieves are washed and put down on
a white board to get an indication of the ratio between the amounts what is on the different sieves. The sieved
drilling fluid is used as for the viscometer. The sieve equipment used is displayed in figure C.3. The sieve test on
site is not only conducted to check for changes but the resulting sieved fluid is also required for the viscometer,
since grains can damage the device and distort the results of the viscometer tests. A time effect is noted in how
long after sieving the viscometer test is performed. Additional research should be conducted to determine the
magnitude of this effect as well as the influence of a vibrating table, used in the sieve test, on the measured fluid
properties. This effect is also noted when testing a sample from the clean inflow, before and after sieving on the
vibrating table.
C.1.7. pH Meter
In Den Helder a pH Meter is used since Teqgel requires a higher pH for optimum properties. This is discovered
during the first drilling in Den Helder so the pH is monitored during the second drilling.
Table C.1: Definitions for different HDD rig classifications (Bueno, 2012).
In addition, for the Mini-HDD classification the following limits are given with respect to the maximum Pull
Forces and Torque, approximate 90 KN and 1.3 KNm respectively. The definitions that are present in (Denekamp
et al., 2000) and (Baik et al., 2002) are slightly different. In (Denekamp et al., 2000) an additional distinction in
midi-rigs, between small and large midi-rigs, is made. It is however important to note that it is partially based
on the same parameters length and pipe diameter. But as it is also important to mention that these definitions
can vary greatly depending on the source. A general trend is that the equipment and techniques become more
sophisticated with an increase in class. In other words; a maxi-HDD rig will have in general a more sophisticated
tracking system than a mini-HDD rig.
Texel
Yg = 2 Yg = 4
D 90 [m] D C al c BH [m] D C al c HB [m] D C al c BH [m] D C al c HB [m]
B-65-TXL-03 0.00031 0.002078 0.002017 0.001039 0.001008
B-65-TXL-04 0.000329 0.001188 0.000839 0.000594 0.00042
B-65-TXL-07 0.000264 0.001781 0.001644 0.000891 0.000822
B-65-TXL-09 0.000211 0.001781 0.001599 0.000891 0.0008
B-65-TXL-10 0.000194 0.001781 0.001644 0.000891 0.000822
B-65-TXL-12 0.000227 0.001484 0.001259 0.000742 0.000629
B-65-TXL-13 0.000206 0.001385 0.001185 0.000693 0.000592
B-65-TXL-15 0.000228 0.001385 0.001185 0.000693 0.000592
B-65-TXL-16 0.000188 0.001484 0.001259 0.000742 0.000629
B-65-TXL-28 0.000203 0.001286 0.000948 0.000643 0.000474
B-65-TXL-30 0.000243 0.001583 0.001343 0.000792 0.000671
B-65-TXL-32 0.000244 0.001484 0.001343 0.000742 0.000671
B-65-TXL-35 0.000375 0.001336 0.000908 0.000668 0.000454
B-65-TXL-40 0.000317 0.000891 0.000622 0.000445 0.000311
B-65-TXL-48 0.000307 0.001188 0.000948 0.000594 0.000474
B-65-TXL-51 0.000313 0.001583 0.001301 0.000792 0.00065
B-65-TXL-74 0.000467 0.001188 0.000829 0.000594 0.000415
B-65-TXL-80 0.00068 0.001089 0.000741 0.000544 0.00037
C-85-TXL-07 0.000434 0.001831 0.001644 0.000915 0.000822
C-85-TXL-09 0.000449 0.00188 0.001733 0.00094 0.000866
C-85-TXL-25 0.000319 0.00188 0.001735 0.00094 0.000868
C-85-TXL-31 0.000274 0.002573 0.002345 0.001286 0.001172
C-85-TXL-43 0.000472 0.001435 0.000691 0.000717 0.000346
C-85-TXL-45 0.000462 0.001237 0.001049 0.000619 0.000525
C-85-TXL-47 0.000479 0.001385 0.001175 0.000693 0.000587
C-85-TXL-51 0.000548 0.001583 0.001385 0.000792 0.000692
117
118 D. Additional Results
Table D.2: The D 90 is the sample, the D C al c is the calculated value using equation 5.42.
Den Helder
Yg = 2 Yg = 4
D 90 [m] D C al c BH [m] D C al c HB [m] D C al c BH [m] D C al c HB [m]
PB1DH-A3-85-02 0.000348 0.001845 0.000194 0.000923 9.69E-05
PB1DH-A3-85-05 0.000345 0.001214 0.000763 0.000607 0.000382
PB1DH-A3-85-11 0.000354 0.001311 0.000775 0.000656 0.000388
PB1DH-A3-85-15 0.000319 0.00102 0.00024 0.00051 0.00012
PB1DH-A3-85-16 0.000495 0.001263 0.000472 0.000631 0.000236
PB1DH-A3-85-22 0.000398 0.001263 0.000644 0.000631 0.000322
PB1DH-A3-85-43 0.00044 0.001748 0.001526 0.000874 0.000763
PB1DH-A3-85-47 0.000439 0.001505 0.001163 0.000753 0.000581
PB1DH-A3-85-51 0.000415 0.001457 0.001318 0.000728 0.000659
PB1DH-A3-85-54 0.000332 0.001554 0.001357 0.000777 0.000678
PB1DH-A3-85-58 0.000269 0.001845 0.001647 0.000923 0.000824
PB1DH-A3-85-62 0.000428 0.0017 0.001524 0.00085 0.000762
PB1DH-A3-85-66 0.000467 0.001894 0.001613 0.000947 0.000807
PB1DH-A3-85-69 0.000433 0.0017 0.001359 0.00085 0.000679
PB1DH-A3-85-71 0.000422 0.001651 0.001308 0.000826 0.000654
PB1DH-A3-85-75 0.000493 0.001845 0.001647 0.000923 0.000824
PB1DH-A1-65-02 0.000497 0.002039 0.001221 0.00102 0.00061
PB1DH-A1-65-05 0.000494 0.0017 0.001134 0.00085 0.000567
PB1DH-A1-65-14 0.000469 0.001651 0.001153 0.000826 0.000577
PB1DH-A1-65-17 0.000536 0.001457 0.000891 0.000728 0.000446
PB1DH-A1-65-20 0.000476 0.001263 0.000727 0.000631 0.000363
PB1DH-A1-65-23 0.000556 0.0017 0.001526 0.00085 0.000763
PB1DH-A1-65-26 0.000504 0.001651 0.001071 0.000826 0.000535
PB1DH-A1-65-29 0.000542 0.001748 0.001112 0.000874 0.000556
Texel - Reynolds Number
Scenario 1 Scenario 2 Scenario 3 Scenario 4 Scenario 5 Scenario 6 Scenario 7 Scenario 8 Scenario 9
BH HB BH HB BH HB BH HB BH HB BH HB BH HB BH HB BH HB
D.2. Reynolds Number
B-65-TXL-03 10.6 12.3 9.1 10.7 5.2 6.1 5.7 6.7 4.9 5.8 2.8 3.3 1.6 1.9 1.4 1.6 0.8 0.9
B-65-TXL-04 9.0 13.0 7.8 11.3 4.4 6.5 4.8 7.1 4.2 6.2 2.8 4.2 1.6 2.4 1.5 2.2 0.9 1.4
B-65-TXL-07 9.9 12.0 8.6 10.4 4.9 5.9 5.3 6.5 4.6 5.6 2.6 3.2 1.5 1.9 1.3 1.6 0.7 0.9
B-65-TXL-09 9.8 12.1 8.5 10.5 4.8 6.0 5.3 6.6 4.5 5.7 2.6 3.3 1.5 1.9 1.3 1.6 0.7 0.9
D.2. Reynolds Number
B-65-TXL-10 9.9 12.0 8.6 10.4 4.9 6.0 5.3 6.5 4.6 5.7 2.6 3.2 1.5 1.9 1.3 1.6 0.7 0.9
B-65-TXL-12 12.2 15.5 10.6 13.5 6.0 7.7 6.5 8.5 5.7 7.3 3.2 4.2 1.8 2.4 1.6 2.1 0.9 1.2
B-65-TXL-13 13.0 15.8 11.2 13.7 6.4 7.9 6.9 8.6 6.0 7.5 3.4 4.3 1.9 2.5 1.7 2.2 1.0 1.2
B-65-TXL-15 13.1 16.1 11.3 14.0 6.4 8.0 7.0 8.8 6.1 7.6 3.4 4.4 2.0 2.5 1.7 2.2 1.0 1.3
B-65-TXL-16 12.5 15.7 10.8 13.6 6.1 7.8 6.7 8.5 5.8 7.4 3.3 4.2 1.9 2.5 1.6 2.1 0.9 1.2
B-65-TXL-28 14.2 19.6 12.3 17.0 7.0 9.8 7.6 10.7 6.6 9.3 3.7 5.3 2.1 3.1 1.8 2.7 1.0 1.5
B-65-TXL-30 11.3 14.3 9.8 12.4 5.6 7.1 6.1 7.8 5.3 6.7 3.0 3.9 1.7 2.2 1.5 1.9 0.8 1.1
B-65-TXL-32 14.6 17.0 12.1 14.2 6.8 8.0 7.4 8.8 6.4 7.6 3.6 4.3 2.0 2.5 1.7 2.1 1.0 1.2
B-65-TXL-35 20.9 29.7 18.1 25.8 10.2 14.9 11.1 16.3 9.6 14.2 5.5 8.2 3.1 4.8 2.6 4.1 1.4 2.2
B-65-TXL-40 31.2 40.3 27.0 35.1 15.3 20.3 16.7 22.4 14.5 19.5 8.2 11.2 4.7 6.7 4.1 5.8 2.3 3.4
all scenarios.
B-65-TXL-48 31.1 38.4 26.9 33.3 14.3 18.1 15.7 19.9 13.5 17.2 7.4 9.5 4.1 5.4 3.5 4.7 2.0 2.6
B-65-TXL-51 29.8 37.1 25.7 32.2 14.4 18.3 15.8 20.1 13.5 17.2 7.4 9.5 4.1 5.4 3.4 4.6 1.8 2.4
B-65-TXL-74 45.1 61.7 39.0 53.7 21.5 30.2 23.8 33.6 20.3 28.8 11.3 16.3 6.4 9.5 5.5 8.2 3.1 4.7
B-65-TXL-80 70.9 93.4 61.4 81.4 28.9 39.4 31.5 43.5 27.3 37.8 16.1 22.7 9.0 13.2 7.8 11.4 4.3 6.4
C-85-TXL-07 20.2 24.4 17.4 21.2 9.9 12.2 10.8 13.3 9.4 11.5 5.3 6.6 3.0 3.8 2.6 3.2 1.3 1.7
C-85-TXL-09 21.4 25.4 18.5 22.1 10.5 12.6 11.4 13.8 9.9 12.0 5.6 6.8 3.2 3.9 2.8 3.4 1.6 2.0
C-85-TXL-25 22.4 27.3 19.4 23.7 11.0 13.5 12.0 14.7 10.6 13.1 6.1 7.6 3.6 4.5 3.1 3.9 1.8 2.2
C-85-TXL-31 17.8 21.6 15.4 18.7 8.8 10.8 9.6 11.8 8.3 10.2 4.7 5.8 2.7 3.4 2.3 2.9 1.3 1.7
C-85-TXL-43 31.8 59.8 27.6 52.1 15.6 30.1 17.0 33.1 14.7 28.8 8.3 16.6 4.8 9.9 4.1 8.6 2.3 4.9
C-85-TXL-45 37.9 45.6 32.8 39.6 18.5 22.7 20.3 24.9 17.5 21.6 9.9 12.4 5.6 7.2 4.9 6.2 2.8 3.6
C-85-TXL-47 34.9 42.5 30.2 36.9 17.0 21.1 18.6 23.2 16.1 20.1 9.1 11.4 5.2 6.7 4.5 5.8 2.5 3.3
C-85-TXL-51 36.0 42.7 31.1 37.1 17.6 21.3 19.2 23.3 16.6 20.2 9.3 11.4 5.1 6.4 4.4 5.5 2.4 3.1
Table D.3: The Reynolds number for every sample, both the Bingham (BH) and the Herschel-Bulkley (HB) fluid model and
119
120
D.3.1. Texel
(a) The yield point according to the best fit of the fluid models. No weighting factor.
(b) The yield point according to the best fit of the fluid models. Weighting factor according to shear rate 1.
(c) The yield point according to the best fit of the fluid models. Weighting factor according to shear rate 2.
Figure D.1: Yield point and the best fit to the experimental data for Texel.
122 D. Additional Results
(a) The yield point according to the best fit of the fluid models. No weighting factor.
(b) The yield point according to the best fit of the fluid models. Weighting factor according to shear rate 1.
(c) The yield point according to the best fit of the fluid models. Weighting factor according to shear rate 2.
Figure D.2: Yield point and the best fit to the experimental data for Den Helder.
D.4. Lag Diagram 123
D.4.1. Texel
133
134 E. Code of the SampleSource Program
45 ! I n p u t f i l e s , a l l are used
46
47 Integer :: O u t p u t =21 , OutputGraph_PD =22 , O u t p u t G r a p h _ S u r =23 , O u t p u t S a m p l e s =24 ,
S a m p l e S o u r c e L o g =25 , SampleLog =26 , O u t p u t L o s s e s =27 , O u t p u t S a m p l e s L o c =28
48 Integer :: O u t p u t F l u i d P r o p e r t i e s =30 , O u t p u t F l u i d P r o p T e x = 31
49 Integer :: O u t p u t T r a n s p o r t P r o p e r t i e s =40 , O u t p u t T r a n s p o r t P r o p T e x = 41
50 ! O u t p u t f i l e s , n o t a l l o f them a r e u s e d i n e v e r y r u n o p t i o n .
51
52 Integer :: T a b l e H a n s =99
53
54 Character (150) : : filename
55 Character (150) : : name
56 Character (150) :: title_graph
57 Character (150) :: title
58
59 Real :: Value , Margin
60 Integer :: I n d e x , Index_PD , I n d e x _ S u r
61 Integer : : Index_PDMF ! Adapted v a l u e f o r s t a b i l i t y r e a s o n s , i t i s t h e
v a l u e l o w e r t h a n Index_PD f o r which a mudflow i s g i v e n i n t h e P r o D a t a f i l e .
62 Integer :: Index_Sol_PD , I n d e x _ S o l _ S u r
63
64 ! S t a n d a r d s and c o n s t a n t v a r i a b l e s
65 Integer :: i , j , MainI ! Do l o o p i n t e g e r s
66 Real ( 8 ) , Parameter :: P I = 4 . d0 * a t a n ( 1 . d0 ) ! Quite p r e c i s e
67 Real , Parameter : : g = 9 . 8 0 6 6 5 d0
68
69 Real , Parameter :: n_BH = 1 . d0
70 Real , Parameter :: MinYg = 2 . d0
71 Real , Parameter :: MaxYg = 4 . d0
72 Real , Parameter :: Rho_Grain = 2 6 5 0 . d0
73
74 ! Variables regarding reading of the input f i l e s
75 Integer :: n l i n e s , n l i n e s _ d a t a , Nlines_PD , N l i n e s _ s u r , i o
76 Integer , Allocatable : : Bit_DPT ( : ) , Hol_DPT ( : ) , Car_POS ( : ) , Car_SPD ( : )
77 Integer , Allocatable :: P u l l ( : ) , Push ( : ) , T o r q _ p o s ( : )
78 Integer , Allocatable : : Rot_SPD ( : ) , M_Press ( : ) , MudFlw ( : ) , T o r q _ n e g ( : )
79 Integer , Allocatable :: P r e s s _ 1 ( : ) , P r e s s _ 2 ( : ) , P r e s s _ 3 ( : ) ,HS_D ( : )
80
81 Character (8) , Allocatable :: D a t e ( : ) , Time ( : )
82 Integer , Allocatable : : J o i nt ( : ) , Btot ( : )
83
84 Real , Allocatable : : CL ( : ) , I n c l i n a t i o n R a w ( : ) , AzimuthRaw ( : )
85 Real , Allocatable : : HS ( : ) , Dip ( : ) , E l e v a t i o n C a l c ( : ) , ElevationMGS ( : )
86 Real , Allocatable : : R_Calc ( : ) ,R_MGS ( : )
87
88 Real ( 8 ) , Allocatable : : Away ( : ) , MD( : )
89
90 ! Variables
91 Character (19) , Allocatable :: DateTime_PD ( : )
92 Character (19) , Allocatable :: DateTime_Sur ( : )
93 Character (19) , Allocatable :: DateTime_Samples ( : )
94 Character (19) :: DateTimeSample
95
96 Integer :: TimeInt
97
98 Integer (2) :: Day , Month , Hours , M i n u t e s , S e c o n d s
99 Integer (4) :: Year
100
101 Integer , Allocatable :: TimeInt_PD ( : ) , T i m e I n t _ S u r ( : )
102 Real , Allocatable :: PumpVol ( : )
103 Real , Allocatable :: TranspLen ( : )
104 Real ( 8 ) , Allocatable :: TranspLenSum ( : )
105
106 Real :: D_bh , D_ds
107 Real :: D_drillbit
108 Real :: Thickness_ds
109 Real :: L e n g t h _ P i p e , Length_BHA
110 Real :: Planned_Azimuth
111 Real :: C o n v e r s i o n _ D e g r _ P a , Conversion_RPM_PerS
112 Real :: Conversion_Degr_lb , Conversion_lb_Pa
113
135
313 RunOption = 1
314
315 Case ( 3 )
316
317 W r i t e ( * , ’ (A) ’ ) " I f only 1 s c e n a r i o i s p r e f e r e d , put ’0 ’ f o r t h e second s c e n a r i o . "
318 W r i t e ( * , ’ (A) ’ ) " Give t h e f i r s t s c e n a r i o : "
319 Read ( * , ’ ( I ) ’ ) ScenarioNo1
320 W r i t e ( * , ’ (A) ’ ) " Give t h e s e c o n d s c e n a r i o : "
321 Read ( * , ’ ( I ) ’ ) ScenarioNo2
322
323 ScenarioNo = ScenarioNo1
324
325 W r i t e ( * , ’ (A) ’ ) "
−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−− "
326
327 W r i t e ( * , ’ (A) ’ ) " Give t h e l o c a t i o n , e i t h e r ’ T e x e l ’ o r ’ Den H e l d e r ’ , most a b b r e v i a t i o n s
are recognized : "
328 Read ( * , ’ (A) ’ ) Location
329 W r i t e ( * , ’ (A) ’ ) "
−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−− "
330
331 RunOption = 1
332
333 Case ( 4 )
334
335 W r i t e ( * , ’ (A) ’ ) " Give t h e f i r s t l o c a t i o n , e i t h e r ’ T e x e l ’ o r ’ Den H e l d e r ’ , most
abbreviations are recognized : "
336 Read ( * , ’ (A) ’ ) Location
337 W r i t e ( * , ’ (A) ’ ) "
−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−− "
338
339 ScenarioNo = 1
340 RunOption = 1
341
342 End S e l e c t
343
344 500 C o n t i n u e ! S t a r t S c e n a r i o Loop
345
346 S e l e c t Case ( L o c a t i o n )
347 ! M u l t i p l e a b b r e v i a t i o n s c a n be u s e d
348 Case ( ’ Den H e l d e r ’ , ’ den h e l d e r ’ , ’DH’ , ’ dh ’ , ’Dh ’ )
349
350 Location = ’ Den H e l d e r ’
351 ! T h i s i s t h e name t h a t i s a l s o p u t i n t h e g r a p h s and f i l e names .
352 Open ( SampleData , f i l e = f i l e f o l d e r _ i n / / " SampleData_DH . c s v " )
353
354 Open ( InputDim , f i l e = f i l e f o l d e r _ i n / / " InputDim_DH . INP " )
355
356 Open ( InputCSV_PD , f i l e = f i l e f o l d e r _ i n / / " InputData_PD_DH . c s v " ) ! The f i l e a s
d o w n l o a d e d from P r o D a t a b u t t i t e l s ( e x c e p t f o r f i r s t l i n e ) a r e removed a s w e l l a s t h e
q u o t a t i o n marks a r o u n d e a c h t e r m .
357
358 Open ( InputCSV_Sur , f i l e = f i l e f o l d e r _ i n / / " InputData_Sur_DH_Total . csv " ) ! All survey
d a t a , from DH, combined i n t o one f i l e .
359
360 Open ( InputMP , f i l e = f i l e f o l d e r _ i n / / " Input_MP_DH . c s v " ) ! Contains the
a n n u l a r m u d p r e s s u r e s p e r j o i n t no .
361
362 Case ( ’ T e x e l ’ , ’ t e x e l ’ , ’TXL ’ , ’ t x l ’ , ’T ’ , ’ t ’ )
363
364 Location = ’ Texel ’
365
366 Open ( SampleData , f i l e = f i l e f o l d e r _ i n / / " SampleData_Texel . csv " )
367
368 Open ( InputDim , f i l e = f i l e f o l d e r _ i n / / " I n p u t D i m _ T e x e l . INP " )
369
370 Open ( InputCSV_PD , f i l e = f i l e f o l d e r _ i n / / " InputData_PD_Texel_V2 . csv " ) ! The
v a l u e s o f t h i s f i l e a r e c a l i b r a t e d a f t e r w a r d s and r o u n d e d , t h e e r r o r t h i s c a u s e s i s
s o p p o s e d t o be o f l i m i t e d i n f l u e n c e c o n s i d e r i n g t h e o t h e r u n c e r t a i n t i e s .
371
372 Open ( InputCSV_Sur , f i l e = f i l e f o l d e r _ i n / / " InputData_Sur_Texel_Total . csv " ) ! All
139
503 D_bh = 1 . 1 d0 * D _ d r i l l b i t
504
505 Write ( * , * )
506 W r i t e ( * , ’ (A) ’ ) "
−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−− "
507
508 Case ( 4 ) ! Medium d i a m e t e r , no l o s s
509 Loss_P = 0 . d0
510 I f ( L o c a t i o n == ’ T e x e l ’ ) D_bh = 0 . 4 0 d0
511 I f ( L o c a t i o n == ’ Den H e l d e r ’ ) D_bh = 0 . 4 5 d0
512
513 Write ( * , * )
514 W r i t e ( * , ’ (A) ’ ) "
−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−− "
515
516 Case ( 5 ) ! Medium d i a m e t e r , t e s t l o s s
517 Loss_P = 0 . 0 7 d0
518 I f ( L o c a t i o n == ’ T e x e l ’ ) D_bh = 0 . 4 0 d0
519 I f ( L o c a t i o n == ’ Den H e l d e r ’ ) D_bh = 0 . 4 5 d0
520
521 Write ( * , * )
522 W r i t e ( * , ’ (A) ’ ) "
−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−− "
523
524 Case ( 6 ) ! Medium d i a m e t e r , 30% l o s s
525 Loss_P = 0 . 3 0 d0
526 I f ( L o c a t i o n == ’ T e x e l ’ ) D_bh = 0 . 4 0 d0
527 I f ( L o c a t i o n == ’ Den H e l d e r ’ ) D_bh = 0 . 4 5 d0
528
529 Write ( * , * )
530 W r i t e ( * , ’ (A) ’ ) "
−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−− "
531
532 Case ( 7 ) ! L a r g e d i a m e t e r , no l o s s
533 Loss_P = 0 . d0
534 I f ( L o c a t i o n == ’ T e x e l ’ ) D_bh = 0 . 5 5 d0
535 I f ( L o c a t i o n == ’ Den H e l d e r ’ ) D_bh = 0 . 8 0 d0
536
537 Write ( * , * )
538 W r i t e ( * , ’ (A) ’ ) "
−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−− "
539
540 Case ( 8 ) ! Large diameter , t e s t l o s s
541 Loss_P = 0 . 0 7 d0
542 I f ( L o c a t i o n == ’ T e x e l ’ ) D_bh = 0 . 5 5 d0
543 I f ( L o c a t i o n == ’ Den H e l d e r ’ ) D_bh = 0 . 8 0 d0
544
545 Write ( * , * )
546 W r i t e ( * , ’ (A) ’ ) "
−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−− "
547
548 Case ( 9 ) ! L a r g e d i a m e t e r , 30% l o s s
549 Loss_P = 0 . 3 0 d0
550 I f ( L o c a t i o n == ’ T e x e l ’ ) D_bh = 0 . 5 5 d0
551 I f ( L o c a t i o n == ’ Den H e l d e r ’ ) D_bh = 0 . 8 0 d0
552
553 Write ( * , * )
554 W r i t e ( * , ’ (A) ’ ) "
−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−− "
555
556 Case D e f a u l t
557
558 Write ( * , * )
559 W r i t e ( * , ’ (A) ’ ) " S o m e t h i n g went wrong . "
560 Write ( * , * )
561 W r i t e ( * , ’ (A) ’ ) "
−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−− "
562 Read ( * , * )
563 Stop
564
565 End S e l e c t
142 E. Code of the SampleSource Program
566
567 End I f
568
569
570 I f ( P r o g r a m O p t i o n == 2 . o r . P r o g r a m O p t i o n == 3 . o r . P r o g r a m O p t i o n == 4 ) Then
571
572 W r i t e ( Name , ’ (A, I 2 . 2 ,A) ’ ) Trim ( S h o r t ( L o c a t i o n ) ) / / " _ O u t p u t S a m p l e s _ S c e n a r i o _ " , S c e n a r i o N o , " .
csv "
573 Open ( O u t p u t S a m p l e s , f i l e = f i l e f o l d e r _ o u t / / t r i m ( Name ) )
574 W r i t e ( O u t p u t S a m p l e s , ’ (A) ’ ) " D a t e Time ; Sample Code ; MainI ; SourceLocAv [m] ;
S a m p l i n g D e p t h T o t ; SamplingAwayTot ; S a m p l i n g R i g h t T o t ; S o u r c e D e p t h T o t ; SourceAwayTot ;
S o u r c e R i g h t T o t ; P o s i t i o n B i t A l l [m] ; Pumptime [ s ] ; HB Tau Y i e l d ; HB K ; HB n [ − ] ;
Alpha ; D e l t a HB ; PV [ Pa . s ] ; YP [ Pa ] ; D e l t a Bingham ; Mud P r e s s u r e A n n u l u s [ Pa ] ;
Maximum P l u g Flow R a d i u s [m] ; T r a n s p o r t P a r a m e t e r BH ; T r a n s p o r t P a r a m e t e r HB ; A v e r a g e
v e l o c i t y [m/ s ] ; Max D i a m e t e r S u s p e n s i o n ; Re_BH ; Re_HB ; Mu_HB ; He_BH ; Max_d_BH ;
v_settle_BH "
575
576 W r i t e ( Name , ’ (A, I 2 . 2 ,A) ’ ) Trim ( S h o r t ( L o c a t i o n ) ) / / " _ O u t p u t S a m p l e s L o c _ S c e n a r i o _ " , S c e n a r i o N o ,
" . txt "
577 Open ( O u t p u t S a m p l e s L o c , f i l e = f i l e f o l d e r _ o u t / / t r i m ( Name ) )
578 W r i t e ( O u t p u t S a m p l e s L o c , ’ (A) ’ ) " Sample_Code , DateTimeSample , SamplingAway , S a m p l i n g D e p t h
, S a m p l i n g R i g h t , SourceAway , S o u r c e D e p t h , S o u r c e R i g h t "
579
580 W r i t e ( Name , ’ (A, I 2 . 2 ,A) ’ ) Trim ( S h o r t ( L o c a t i o n ) ) / / " _ F l u i d P r o p e r t i e s _ S c e n a r i o _ " , S c e n a r i o N o , "
. csv "
581 Open ( O u t p u t F l u i d P r o p e r t i e s , f i l e = f i l e f o l d e r _ o u t / / t r i m ( Name ) )
582 W r i t e ( O u t p u t F l u i d P r o p e r t i e s , ’ (A) ’ ) " Sample_Code ; DateTimeSample ; HB Tau Y i e l d ; HB K
; HB n [ − ] ; Alpha ; D e l t a HB ; PV [ Pa . s ] ; YP [ Pa ] ; D e l t a Bingham "
583
584 W r i t e ( Name , ’ (A, I 2 . 2 ,A) ’ ) Trim ( S h o r t ( L o c a t i o n ) ) / / " _ F l u i d P r o p T e x _ S c e n a r i o _ " , S c e n a r i o N o , " .
txt "
585 Open ( O u t p u t F l u i d P r o p T e x , f i l e = f i l e f o l d e r _ o u t / / t r i m ( Name ) )
586 W r i t e ( O u t p u t F l u i d P r o p T e x , ’ (A) ’ ) " Sample_Code , DateTimeSample , HB Tau Y i e l d , HB K, HB n
[ − ] , Alpha , D e l t a HB, PV [ Pa . s ] , YP [ Pa ] , D e l t a Bingham "
587
588 W r i t e ( Name , ’ (A, I 2 . 2 ,A) ’ ) Trim ( S h o r t ( L o c a t i o n ) ) / / " _ O u t p u t L o s s e s _ S c e n a r i o _ " , S c e n a r i o N o , " .
csv "
589 Open ( O u t p u t L o s s e s , f i l e = f i l e f o l d e r _ o u t / / t r i m ( Name ) )
590 W r i t e ( O u t p u t L o s s e s , ’ (A) ’ ) " Sample Code ; Loss_P [%] ; I n f i l L o s s P e r c _ B H [%] ;
I n f i l L o s s P e r c _ H B [%] "
591
592 W r i t e ( Name , ’ (A, I 2 . 2 ,A) ’ ) Trim ( S h o r t ( L o c a t i o n ) ) / / " _ T r a n s p o r t P r o p e r t i e s _ S c e n a r i o _ " ,
ScenarioNo , " . csv "
593 Open ( O u t p u t T r a n s p o r t P r o p e r t i e s , f i l e = f i l e f o l d e r _ o u t / / t r i m ( Name ) )
594 W r i t e ( O u t p u t T r a n s p o r t P r o p e r t i e s , ’ (A) ’ ) " Sample_Code ; DateTimeSample ; MaxPlugR ;
AverageV ; D_Max ; S h e a r R a t e Downhole1 [ 1 / s ] ; S h e a r R a t e Downhole2 [ 1 / s ] ; Re_Gen_BH ;
Re_Gen_HB ; D90 Sample ; Dmax BH Min ; Dmax BH Max ; Dmax HB Min ; Dmax HB Max ;
DeltaWeightBH1 ; DeltaWeightBH2 ; DeltaWeightHB1 ; DeltaWeightHB2 "
595
596 W r i t e ( Name , ’ (A, I 2 . 2 ,A) ’ ) Trim ( S h o r t ( L o c a t i o n ) ) / / " _ T r a n s p o r t P r o p T e x _ S c e n a r i o _ " , S c e n a r i o N o ,
" . txt "
597 Open ( O u t p u t T r a n s p o r t P r o p T e x , f i l e = f i l e f o l d e r _ o u t / / t r i m ( Name ) )
598 W r i t e ( O u t p u t T r a n s p o r t P r o p T e x , ’ (A) ’ ) " Sample_Code , DateTimeSample , MaxPlugR , AverageV ,
D_Max , S h e a r R a t e Downhole1 [ 1 / s ] , S h e a r R a t e Downhole2 [ 1 / s ] , E f f V i s c HB, Re_Gen_BH ,
Re_Gen_HB , D90 Sample , Dmax BH Min , Dmax BH Max , Dmax HB Min , Dmax HB Max , DeltaWeightBH1
, DeltaWeightBH2 , DeltaWeightHB1 , DeltaWeightHB2 "
599
600 W r i t e ( Name , ’ (A, I 2 . 2 ,A) ’ ) Trim ( S h o r t ( L o c a t i o n ) ) / / " _ S a m p l e S o u r c e L o g _ S c e n a r i o _ " , S c e n a r i o N o , "
. txt "
601 Open ( SampleSourceLog , f i l e = f i l e f o l d e r _ o u t / / t r i m ( Name ) )
602
603 Else
604
605 W r i t e ( Name , ’ (A, F4 . 2 ,A) ’ ) Trim ( S h o r t ( L o c a t i o n ) ) / / " _ O u t p u t S a m p l e s _ " , D_Bh , " − " , Loss_P , " . c s v "
! I n c l u d e s t h e r e s u l t s o f t h e main do l o o p , s o r e s u l t s o f a l l c a l c u l a t i o n and o f
a l l samples . . .
606 Open ( O u t p u t S a m p l e s , f i l e = f i l e f o l d e r _ o u t _ 1 / / t r i m ( Name ) )
607 W r i t e ( O u t p u t S a m p l e s , ’ (A) ’ ) " D a t e Time ; Sample Code ; MainI ; SourceLocAv [m] ;
S a m p l i n g D e p t h T o t ; SamplingAwayTot ; S a m p l i n g R i g h t T o t ; S o u r c e D e p t h T o t ; SourceAwayTot ;
S o u r c e R i g h t T o t ; P o s i t i o n B i t A l l [m] ; Pumptime [ s ] ; HB Tau Y i e l d ; HB K ; HB n [ − ] ;
Alpha ; D e l t a HB ; PV [ Pa . s ] ; YP [ Pa ] ; D e l t a Bingham ; Mud P r e s s u r e A n n u l u s [ Pa ] ;
143
736
737 ! F i l l i n g the vector c o n t a i n i n g the r e s u l t s of a l l the samples .
738 S a m p l i n g D e p t h T o t ( MainI ) = SamplingDepth
739 SamplingAwayTot ( MainI ) = SamplingAway
740 S a m p l i n g R i g h t T o t ( MainI ) = SamplingRight
741
742 ! −−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−
743 ! C a l c u l a t i o n s − Main
744 ! −−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−
745 ! Fluid Parameters
746 ! −−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−
747
748 I f ( RPM_600 ( MainI ) <= 0 . o r . RPM_300 ( MainI ) <= 0 . o r . RPM_200 ( MainI ) <= 0 . o r . RPM_100 ( MainI )
<= 0 . o r . RPM_60 ( MainI ) <= 0 . o r . RPM_30 ( MainI ) <= 0 . o r . RPM_6 ( MainI ) <= 0 . o r . RPM_3 (
MainI ) <= 0 ) Then
749
750 FluidData = ’No ’ ! D e f i n i t i o n of the FluidData case .
751
752 W r i t e ( Message , ’ (A) ’ ) " F l u i d d a t a i s missing or incomplete , f l u i d p r o p e r t i e s couldn ’ t
be d e t e r m i n e d . "
753 C a l l W r i t e L o g ( 1 , t r i m ( Message ) )
754
755 NoFluid_No = NoFluid_No + 1 ! C o u n t e r t h a t k e e p s t r a c k o f t h e amount o f
samples with , m i s s i n g or i n c o m p l e t e r d a t a .
756
757 ! N e c e s s a r y o r p r o g r a m s t a r t a s s i g n i n g i t s own v a l u e s t o t h e v a r i a b l e s .
758 Tau_Yield_HB_Tot ( MainI ) = 0 . d0
759 K_Tot ( MainI ) = 0 . d0
760 n _ T o t ( MainI ) = 0 . d0
761 A l p h a _ T o t ( MainI ) = 0 . d0
762 Delta_Tot_HB ( MainI ) = 0 . d0
763 Delta_Tot_BH ( MainI ) = 0 . d0
764 PV_Tot ( MainI ) = 0 . d0
765 YP_Tot ( MainI ) = 0 . d0
766
767 Else
768 FluidData = ’ Yes ’ ! D e f i n i t i o n of the FluidData case .
769
770 W r i t e ( Message , ’ (A) ’ ) " F l u i d d a t a i s p r e s e n t and c o m p l e t e . "
771 C a l l W r i t e L o g ( 1 , t r i m ( Message ) )
772
773 ! HB
774 ! −−−−−−−−−−−−−−−−−−−−−−
775 C a l l H e r s c h e l _ B u l k l e y ( LogGamma , Y, Tau_Yield_HB , K, n , Alpha , D e l t a , Sample_Code , MainI ,
C o n v e r s i o n _ D e g r _ P a , RPM_600 , RPM_300 , RPM_200 , RPM_100 , RPM_60 , RPM_30 , RPM_6 , RPM_3 , GammaY , Tau ,
Tau_Calc_HB , A l p h a _ A l l , D e l t a _ A l l )
776
777 K_Tot ( MainI ) = K ! F i l l i n g the vector containing the r e s u l t s
of a l l the samples .
778 n _ T o t ( MainI ) = n
779 Tau_Yield_HB_Tot ( MainI ) = Tau_Yield_HB
780 A l p h a _ T o t ( MainI ) = Alpha
781 Delta_Tot_HB ( MainI ) = Delta
782
783 W r i t e ( Message , ’ (A, F5 . 3 , A, F5 . 3 , A, F4 . 2 , A, F8 . 3 ) ’ ) "K, n , Alpha and D e l t a : " ,K, " , " , n , " , " ,
Alpha , " and " , D e l t a
784 C a l l W r i t e L o g ( 1 , t r i m ( Message ) )
785
786 ! Bingham
787 ! −−−−−−−−−−−−−−−−−−−−−−
788 C a l l Bingham ( MainI , PV , YP , RPM_600 , RPM_300 , C o n v e r s i o n _ D e g r _ l b , C o n v e r s i o n _ l b _ P a ,
Conversion_RPM_PerS , GammaY , Tau_Calc_BH , Tau , D e l t a )
789
790 PV_Tot ( MainI ) = PV ! F i l l i n g the vector c o n t a i n i n g the r e s u l t s of a l l
the samples .
791 YP_Tot ( MainI ) = YP
792 Delta_Tot_BH ( MainI ) = Delta
793
794 W r i t e ( Message , ’ (A, F , A, F5 . 2 , A, F8 . 3 ) ’ ) "PV , YP and D e l t a : " ,PV , " , " ,YP , " and " , D e l t a
795 C a l l W r i t e L o g ( 1 , t r i m ( Message ) )
796
146 E. Code of the SampleSource Program
797 ! −−−−−−−−−−−−−−−−−−−−−−
798
799 Write ( * , * )
800 I f ( Delta_Tot_HB ( MainI ) < Delta_Tot_BH ( MainI ) ) Then
801 W r i t e ( Message , ’ (A) ’ ) " F l u i d p a r a m e t e r s d e t e r m i n e d and Herschel Bulkley r e s u l t s in
the best f i t . "
802 C a l l W r i t e L o g ( 1 , t r i m ( Message ) )
803 HB_No = HB_No + 1 ! Counter t h a t keeps t r a c k o f t h e amount o f s a m p l e s
where H e r s c h e l − B u l k l e y i s t h e b e s t f i t .
804 Else
805 W r i t e ( Message , ’ (A) ’ ) " F l u i d p a r a m e t e r s d e t e r m i n e d and Bingham r e s u l t s i n t h e b e s t
fit ."
806 C a l l W r i t e L o g ( 1 , t r i m ( Message ) )
807 BH_No = BH_No + 1 ! Counter t h a t keeps t r a c k o f t h e amount o f s a m p l e s
where Bingham i s t h e b e s t f i t .
808 End I f
809 End I f
810
811 I f ( RunOption == 2 ) W r i t e ( * , * ) " Check "
812
813 ! −−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−
814
815 C a l l T i m e I n t e r v a l _ P D ( TimeInt_PD , DateTime_PD , Index_PD )
816 ! P r o D a t a t i m e i n t e r v a l from t h e Index_PD t o t h e s t a r t o f t h e d r i l l i n g .
817 ! The s u b r o u t i n e t a k e s t h e s t o p s i n t o a c c o u n t and t h e l a r g e r i n t e r v a l s due t o m i s s i n g d a t a .
818
819 C a l l T r a n s p o r t L e n g t h _ P D ( PumpVol , Index_PD , A_bh , TranspLen , TranspLenSum , TimeInt_PD , MudFlw , Loss_P
)
820
821 I f ( RunOption == 2 ) W r i t e ( * , ’ (A) ’ ) " Check 6 . 3 "
822
823 C a l l I n t e r s e c t i o n ( DateTime_PD , Index_PD , DateTime_Sur , I n d e x _ S u r , TranspLenSum ,MD, Index_Sol_PD ,
I n d e x _ S o l _ S u r , S o u r c e L o c _ S u r , SourceLoc_PD , SourceLocAv , DateTimeSample )
824 ! Works and d e l i v e r s t h e i n d i c e s o f t h e PD and S u r d a t a b a s e s t h a t r e s u l t i n Away and
TransLenSum h a v i n g e x a c t o r a p p r o x i m a t e l y t h e same v a l u e .
825
826 S o u r c e L o c A v A l l ( MainI ) = SourceLocAv ! F i l l i n g the vector containing the r e s u l t s
of a l l the samples .
827 P o s i t i o n B i t A l l ( MainI ) = MD( I n d e x _ S u r )
828
829 C a l l S o u r c e L o c a t i o n ( I n d e x _ S o l _ S u r , SourceLocAv , MD, E l e v a t i o n C a l c , Away , R_Calc , S o u r c e D e p t h ,
SourceAway , S o u r c e R i g h t )
830
831 S o u r c e D e p t h T o t ( MainI ) = SourceDepth
832 SourceAwayTot ( MainI ) = SourceAway
833 S o u r c e R i g h t T o t ( MainI ) = SourceRight
834
835 I f ( RunOption == 2 ) W r i t e ( * , ’ (A) ’ ) " Check 6 . 4 "
836
837 I f ( I n d e x _ S o l _ P D > 0 . and . I n d e x _ S o l _ S u r > 0 ) Then
838 C a l l T r a n s p o r t T i m e s ( DateTime_PD , DateTime_Sur , Index_Sol_PD , I n d e x _ S o l _ S u r , DateTimeSample ,
T i m e I n t 1 , T i m e I n t 2 , TimeIntAv )
839 T i m e I n t A v A l l ( MainI ) = TimeIntAv
840
841 I f ( RunOption == 2 ) W r i t e ( * , ’ (A) ’ ) " Check 6 . 5 "
842
843 C a l l PumpTimes ( MudFlw , TimeInt_PD , Index_Sol_PD , Index_PD , PumpTime )
844 PumpTimesAll ( MainI ) = PumpTime
845
846 I f ( RunOption == 2 ) W r i t e ( * , ’ (A) ’ ) " Check 7 "
847
848 Else
849 W r i t e ( Message , ’ (A) ’ ) "No s o l u t i o n was found , s o b o t h t r a n s p o r t and pump t i m e can ’ t be
calculated . "
850 C a l l W r i t e L o g ( 1 , t r i m ( Message ) )
851
852 T i m e I n t A v A l l ( MainI ) = 0 . d0
853 PumpTimesAll ( MainI ) = 0 . d0
854 End I f
855
856 ! −−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−
147
857
858 S e l e c t Case ( F l u i d D a t a )
859
860 Case ( ’ Yes ’ )
861 W r i t e ( Message , ’ (A) ’ ) " F l u i d d a t a i s f o u n d and c o m p l e t e . "
862 C a l l W r i t e L o g ( 1 , t r i m ( Message ) )
863
864 ! Write ( * , ’ ( A, F ) ’) " A_bh " , A_bh
865 ! Write ( * , ’ ( A, F ) ’) " Loss_P " , Loss_P
866 ! Write ( * , ’ ( A, I ) ’) " Index_PD " , Index_PD
867 ! Write ( * , ’ ( A, I ) ’) " Index_Sol_PD " , Index_Sol_PD
868
869 C a l l F l u i d V e l o c i t y ( AverageV , MaxV , Index_PD , Index_Sol_PD , MudFlw , A_bh , Loss_P )
870
871 AverageV_Tot ( MainI ) = AverageV
872 MaxV_Tot ( MainI ) = MaxV
873
874 v = AverageV_Tot ( MainI )
875
876 I f ( L o c a t i o n == ’ Den H e l d e r ’ ) D90 = D( MainI , 9 0 ) / 1 0 0 0 ! [m]
877 I f ( L o c a t i o n == ’ T e x e l ’ ) D90 = D( MainI + 3 1 , 9 0 ) / 1 0 0 0 ! The a r r a y D c o n t a i n s a l l
s a m p l e s and t h o s e o f DH a r e on t o p .
878
879 Call D m a x T r a n s p o r t ( MinYg , YP_Tot ( MainI ) , Rho_Inflow , Rho_Grain , g , DmaxTrMinBH , ’BH ’ )
880 Call D m a x T r a n s p o r t ( MinYg , Tau_Yield_HB_Tot ( MainI ) , Rho_Inflow , Rho_Grain , g , DmaxTrMinHB , ’HB ’ )
881 Call D m a x T r a n s p o r t ( MaxYg , YP_Tot ( MainI ) , Rho_Inflow , Rho_Grain , g , DmaxTrMaxBH , ’BH ’ )
882 Call D m a x T r a n s p o r t ( MaxYg , Tau_Yield_HB_Tot ( MainI ) , Rho_Inflow , Rho_Grain , g , DmaxTrMaxHB , ’HB ’ )
883
884 DmaxTrMinBH_Tot ( MainI ) = DmaxTrMinBH
885 DmaxTrMinHB_Tot ( MainI ) = DmaxTrMinHB
886 DmaxTrMaxBH_Tot ( MainI ) = DmaxTrMaxBH
887 DmaxTrMaxHB_Tot ( MainI ) = DmaxTrMaxHB
888
889 C a l l MaxDiameterSusp ( D_max , v , g , D_bh , Rho_Grain , Rho_Bf ( MainI ) , SC ( MainI ) )
890 D_Max_Tot ( MainI ) = D_Max
891
892 JointNo = J o i n t ( Index_Sol_Sur )
893
894 C a l l M u d P r e s s u r e ( L o c a t i o n , DateTimeSample , P_Real , A c t i v i t y , J o i n t N o , Joint_MP , Mud_P )
895
896 Mud_P_Tot ( MainI ) = Mud_P
897
898 I f ( Delta_Tot_HB ( MainI ) < Delta_Tot_BH ( MainI ) ) Then ! Means t h a t t h e H e r s c h e l
B u l k l e y method i s more p r e c i s e t h a n t h e Bingham method .
899 Tau_Y = Alpha * Tau ( 1 )
900 Else
901 Tau_Y = YP_Tot ( MainI )
902 End I f
903
904 C a l l MaxPlugRadius ( Tau_Y ,MD( I n d e x _ S u r ) , Mud_P_Tot ( MainI ) , MaxPlugR )
905 MaxPlugR_Tot ( MainI ) = MaxPlugR
906
907 W r i t e ( * , ’ (A, F ) ’ ) " Mud_P_Tot ( MainI ) : " , Mud_P_Tot ( MainI )
908
909 C a l l MaxPlugRadius2 ( Tau_Y ,MD( I n d e x _ S u r ) , Mud_P_Tot ( MainI ) , MaxPlugR , D_bh , D_ds )
910
911 D15 = D( MainI , 1 5 ) / 1 0 0 0 . d0 ! [m]
912
913 I f ( MudFlw ( Index_PD ) == 0 . d0 ) Then
914 Do i =1 ,301
915 I f ( MudFlw ( Index_PD − i ) > 0 . d0 ) Then
916 Index_PDMF = Index_PD − i
917 exit
918 End I f
919 End Do
920 Else
921 Index_PDMF = Index_PD
922 End I f
923
924 C a l l I n f i l t r a t i o n L o s s B T L ( L o c a t i o n , g , Loss_BH , S o u r c e D e p t h T o t ( MainI ) , YP_Tot ( MainI ) , D15 , D_bh ,
Mud_P_Tot ( MainI ) , P I )
148 E. Code of the SampleSource Program
1054 Max_d_BH = 0 . d0
1055 Max_d_BH_Tot ( MainI ) = Max_d_BH
1056 v_settle_BH = 0 . d0
1057 v _ s e t t l e _ B H _ T o t ( MainI ) = v_settle_BH
1058 Gamma_Ann1 = 0 . d0
1059 Gamma_Ann_Tot1 ( MainI ) = Gamma_Ann1
1060 Gamma_Ann2 = 0 . d0
1061 Gamma_Ann_Tot2 ( MainI ) = Gamma_Ann2
1062 DeltaWeightBH1 = 0 . d0
1063 DeltaWeightBH2 = 0 . d0
1064 DeltaWeightHB1 = 0 . d0
1065 DeltaWeightHB2 = 0 . d0
1066 Re_Gen_BH = 0 . d0
1067 Re_Gen_BH_Tot ( MainI ) = Re_Gen_BH
1068 Re_Gen_HB = 0 . d0
1069 Re_Gen_HB_Tot ( MainI ) = Re_Gen_HB
1070
1071 W r i t e ( * , ’ (A) ’ ) " Check F l u i d d a t a ’No ’ "
1072
1073 Case D e f a u l t
1074
1075 W r i t e ( * , ’ (A) ’ ) " S o m e t h i n g went wrong i n t h e s e l e c t i o n o f t h e f l u i d d a t a c a s e l o o p . "
1076 Read ( * , * )
1077
1078 End S e l e c t
1079
1080 ! −−−−−−−−−−−−−−−−−−−−−−
1081 ! Write F i l e s
1082 ! −−−−−−−−−−−−−−−−−−−−−−
1083 ! Adds a comma− d e l i m i t e d t i t l e i n t h e f i l e w i t h t h e c o n t e n t and t h e u n i t o f t h e v e c t o r
1084 ! Based on h t t p s : / / s o f t w a r e . i n t e l . com / en − u s / f o r u m s / t o p i c / 3 5 5 4 2 8 .
1085 ! P a r t i a l l y b a s e d on h t t p : / / s t a c k o v e r f l o w . com / q u e s t i o n s / 2 1 1 1 7 2 1 6 / f o r t r a n − f o r m a t e d − o u t p u t −
f o r − f l o a t i n g − p o i n t − numbers
1086
1087 W r i t e ( O u t p u t S a m p l e s , ’ ( 4 (A) , I , 8 ( A, F ) ,A, I 5 . 5 , 1 4 ( A, F ) ) ’ ) Sample_Code , " ; " , DateTimeSample , " ; "
, MainI , " ; " , S o u r c e L o c A v A l l ( MainI ) , " ; " , S a m p l i n g D e p t h T o t ( MainI ) , " ; " , SamplingAwayTot ( MainI )
, " ; " , S a m p l i n g R i g h t T o t ( MainI ) , " ; " , S o u r c e D e p t h T o t ( MainI ) , " ; " , SourceAwayTot ( MainI ) , " ; " ,
S o u r c e R i g h t T o t ( MainI ) , " ; " , P o s i t i o n B i t A l l ( MainI ) , " ; " , PumpTime , " ; " , Tau_Yield_HB_Tot ( MainI )
, " ; " , K_Tot ( MainI ) , " ; " , n _ T o t ( MainI ) , " ; " , A l p h a _ T o t ( MainI ) , " ; " , Delta_Tot_HB ( MainI ) , " ; " ,
PV_Tot ( MainI ) , " ; " , YP_Tot ( MainI ) , " ; " , Delta_Tot_BH ( MainI ) , " ; " , Mud_P_Tot ( MainI ) , " ; " ,
MaxPlugR_Tot ( MainI ) , " ; " , AverageV_Tot ( MainI ) , " ; " , D_Max_Tot ( MainI ) , " ; " , Max_d_BH_Tot ( MainI ) ,
" ; " , v _ s e t t l e _ B H _ T o t ( MainI )
1088
1089 W r i t e ( O u t p u t S a m p l e s L o c , ’ ( 2 (A) , 6 ( F ) ) ’ ) Sample_Code , DateTimeSample ,
SamplingAwayTot ( MainI ) , S a m p l i n g D e p t h T o t ( MainI ) , S a m p l i n g R i g h t T o t ( MainI ) , SourceAwayTot (
MainI ) , S o u r c e D e p t h T o t ( MainI ) , S o u r c e R i g h t T o t ( MainI )
1090
1091 W r i t e ( O u t p u t F l u i d P r o p e r t i e s , ’ ( 3 (A) , 8 ( A, F ) ) ’ ) Sample_Code , " ; " , DateTimeSample , " ; " ,
Tau_Yield_HB_Tot ( MainI ) , " ; " , K_Tot ( MainI ) , " ; " , n _ T o t ( MainI ) , " ; " , A l p h a _ T o t ( MainI ) , " ; " ,
Delta_Tot_HB ( MainI ) , " ; " , PV_Tot ( MainI ) , " ; " , YP_Tot ( MainI ) , " ; " , Delta_Tot_BH ( MainI )
1092
1093 W r i t e ( O u t p u t F l u i d P r o p T e x , ’ ( 2 (A) , 8 ( F ) ) ’ ) Sample_Code , DateTimeSample ,
Tau_Yield_HB_Tot ( MainI ) , K_Tot ( MainI ) , n _ T o t ( MainI ) , A l p h a _ T o t ( MainI ) , Delta_Tot_HB ( MainI ) ,
PV_Tot ( MainI ) , YP_Tot ( MainI ) , Delta_Tot_BH ( MainI )
1094
1095 W r i t e ( O u t p u t T r a n s p o r t P r o p e r t i e s , ’ ( 3 (A) , 1 6 (A, F ) ) ’ ) Sample_Code , " ; " , DateTimeSample , " ; " ,
MaxPlugR_Tot ( MainI ) , " ; " , AverageV_Tot ( MainI ) , " ; " , D_Max_Tot ( MainI ) , " ; " , Gamma_Ann_Tot1 ( MainI
) , " ; " , Gamma_Ann_Tot2 ( MainI ) , " ; " , Re_Gen_BH_Tot ( MainI ) , " ; " , Re_Gen_HB_Tot ( MainI ) , " ; " , D90 , " ; "
, DmaxTrMinBH_Tot ( MainI ) , " ; " , DmaxTrMaxBH_Tot ( MainI ) , " ; " , DmaxTrMinHB_Tot ( MainI ) , " ; " ,
DmaxTrMaxHB_Tot ( MainI ) , " ; " , DeltaWeightBH1 , " ; " , DeltaWeightBH2 , " ; " , DeltaWeightHB1 , " ; " ,
DeltaWeightHB2
1096
1097 W r i t e ( O u t p u t T r a n s p o r t P r o p T e x , ’ ( 2 (A) , 1 6 ( F ) ) ’ ) Sample_Code , DateTimeSample ,
MaxPlugR_Tot ( MainI ) , AverageV_Tot ( MainI ) , D_Max_Tot ( MainI ) , Gamma_Ann_Tot1 ( MainI ) ,
Gamma_Ann_Tot2 ( MainI ) , Re_Gen_BH_Tot ( MainI ) , Re_Gen_HB_Tot ( MainI ) , D90 , DmaxTrMinBH_Tot ( MainI
) , DmaxTrMaxBH_Tot ( MainI ) , DmaxTrMinHB_Tot ( MainI ) , DmaxTrMaxHB_Tot ( MainI ) , DeltaWeightBH1 ,
DeltaWeightBH2 , DeltaWeightHB1 , DeltaWeightHB2
1098
1099 I f ( RunOption == 2 ) W r i t e ( TableHans , ’ ( 3 (A) , 6 ( A, F ) ) ’ ) Sample_Code , " ; " , S i e v e _ C o d e ( MainI ) , " ; "
, SamplingAwayTot ( MainI ) , " ; " , SourceAwayTot ( MainI ) , " ; " ,MD( I n d e x _ S u r ) , " ; " ,MD( I n d e x _ S o l _ S u r ) ,
" ; " , S a m p l i n g D e p t h T o t ( MainI ) , " ; " , S o u r c e D e p t h T o t ( MainI )
151
1155 C a l l W r i t e L o g ( 2 , t r i m ( Message ) , S a m p l e S o u r c e L o g )
1156
1157 W r i t e ( Message , ’ (A, I3 , A, I3 , A, I3 , A) ’ ) " F o r Gamma_Ann1 was Bingham " , DeltaWBH1_No , " t i m e s t h e
b e s t f i t , t h e H e r s c h e l − B u l k l e y model was " , DeltaWHB1_No , " t i m e s t h e b e s t f i t . "
1158 C a l l W r i t e L o g ( 2 , t r i m ( Message ) , S a m p l e S o u r c e L o g )
1159
1160 W r i t e ( Message , ’ (A, I3 , A, I3 , A, I3 , A) ’ ) " F o r Gamma_Ann2 was Bingham " , DeltaWBH2_No , " t i m e s t h e
b e s t f i t , t h e H e r s c h e l − B u l k l e y model was " , DeltaWHB2_No , " t i m e s t h e b e s t f i t . "
1161 C a l l W r i t e L o g ( 2 , t r i m ( Message ) , S a m p l e S o u r c e L o g )
1162
1163 Write ( * , * )
1164 W r i t e ( * , ’ (A) ’ ) "
−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−− "
1165
1166
1167
1168 ! −−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−
1169 ! C a l l i n g Gnuplot
1170 ! −−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−
1171
1172 I f ( RunOption == 2 ) W r i t e ( * , ’ (A) ’ ) " Check F1 "
1173
1174 ! Times o v e r v i e w
1175 W r i t e ( f i l e n a m e , ’ (A, I 2 . 2 ) ’ ) t r i m ( s h o r t ( L o c a t i o n ) ) / / ’ _ T i m e s _ v s _ L e n g t h _ − _ S c e n a r i o _ ’ , S c e n a r i o N o
1176 W r i t e ( t i t l e , ’ (A, I 2 . 2 ) ’ ) t r i m ( L o c a t i o n ) / / ’ Times v s . L e n g t h S c e n a r i o ’ , S c e n a r i o N o
1177 C a l l f 2 g p 2 ( DateTime_Samples , T i m e I n t A v A l l , PumpTimesAll , DateTime_Sur , Away , 1 , f i l e n a m e , t r i m ( t i t l e
) , ’ D a t e Time ’ , ’ Time [ s ] ’ , ’ L e n g t h [m] ’ , ’ T r a n s p o r t Time [ s ] ’ , ’ L e n g t h [m] ’ , ’ Pump Time [ s ] ’ )
1178 ! ( x1 , y1a , y1b , x2 , y2 , t y p e o f g r a p h , x − a x i s t i t l e , y − a x i s t i t l e 1 , y − a x i s t i t l e 2 , g r a p h 1 t i t l e
, graph2 t i t l e , graph3 t i t l e )
1179
1180 I f ( RunOption == 2 ) W r i t e ( * , ’ (A) ’ ) " Check F2 "
1181
1182 ! Length vs . Source l o c a t i o n
1183 W r i t e ( f i l e n a m e , ’ (A, I 2 . 2 ) ’ ) t r i m ( s h o r t ( L o c a t i o n ) ) / / ’ _ L e n g t h _ v s _ S o u r c e _ − _ S c e n a r i o _ ’ , S c e n a r i o N o
1184 W r i t e ( t i t l e , ’ (A, I 2 . 2 ) ’ ) t r i m ( L o c a t i o n ) / / ’ L e n g t h v s . S o u r c e S c e n a r i o ’ , S c e n a r i o N o
1185 C a l l f 2 g p 3 ( L o c a t i o n , DateTime_Samples , SourceLocAvAll , ’ 3 a ’ , DateTime_Sur ,MD, ’ 2 b ’ , 1 , t r i m ( f i l e n a m e
) , t r i m ( t i t l e ) , ’ D a t e Time ’ , ’ L e n g t h [m] ’ , ’ S o u r c e L o c a t i o n [m] ’ , ’ L e n g t h [m] ’ )
1186 ! ( x1 , y1 , x2 , y2 , t y p e o f g r a p h , t i t l e , x − a x i s t i t l e , y − a x i s t i t l e , g r a p h 1 t i t l e , g r a p h 2 t i t l e
)
1187
1188 I f ( RunOption == 2 ) W r i t e ( * , ’ (A) ’ ) " Check F3 "
1189
1190 ! Lag Diagram
1191 W r i t e ( f i l e n a m e , ’ (A, I 2 . 2 ) ’ ) t r i m ( s h o r t ( L o c a t i o n ) ) / / ’ _ L a g _ D i a g r a m _ S c e n a r i o _ ’ , S c e n a r i o N o
1192 W r i t e ( t i t l e _ g r a p h , ’ (A, I 2 . 2 ) ’ ) Trim ( s h o r t ( L o c a t i o n ) ) / / ’ Lag Diagram S c e n a r i o ’ , S c e n a r i o N o
1193 C a l l f2gpLagD ( L o c a t i o n , t i t l e _ g r a p h , P o s i t i o n B i t A l l , SourceLocAvAll , 1 , ’ P o s i t i o n Head [m] ’ , ’
S o u r c e L o c a t i o n [m] ’ , t r i m ( f i l e n a m e ) , ’V_T = V_L ’ , ’ 1 k ’ , ’ 1 l ’ , ’ 1m’ , ’ 1 n ’ )
1194 ! ( x d a t a , y d a t a , t y p e o f g r a p h , x− a x i s t i t l e , y− a x i s t i t l e , t i t l e , g r a p h t i t l e )
1195
1196 Open ( 1 0 , f i l e = f i l e f o l d e r _ o u t / / ’ E x t r a F i l e s \ ’ / / t r i m ( f i l e n a m e ) / / ’ . t x t ’ )
1197 Do i =1 , s i z e ( P o s i t i o n B i t A l l )
1198 Write ( 1 0 , ’ ( 2 ( F ) ) ’ ) P o s i t i o n B i t A l l ( i ) , SourceLocAvAll ( i )
1199 End Do
1200 Close (10)
1201
1202 I f ( RunOption == 2 ) W r i t e ( * , ’ (A) ’ ) " Check F4 "
1203
1204 W r i t e ( * , ’ (A) ’ ) " Check G r a p h s "
1205
1206 ! −−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−
1207 ! End o f p r o g r a m
1208 ! −−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−
1209 ! D e a l l o c a t i o n ( f o r p o s s i b l e r e r u n s w i t h i n t h e program i n t h e f u t u r e )
1210 ! −−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−
1211
1212 D e a l l o c a t e ( DateTime_PD , Bit_DPT , Hol_DPT , Car_POS , Car_SPD , P u l l , Push , Torq_pos , Rot_SPD )
1213 D e a l l o c a t e ( M_Press , MudFlw , Torq_neg , P r e s s _ 1 , P r e s s _ 2 , P r e s s _ 3 , HS_D )
1214
1215 D e a l l o c a t e ( DateTime_Sur , J o i n t , CL ,MD, I n c l i n a t i o n R a w , AzimuthRaw , B t o t , Dip )
1216 D e a l l o c a t e ( E l e v a t i o n C a l c , ElevationMGS , Away , R_Calc , R_MGS)
1217 D e a l l o c a t e ( DateTime_Samples , Sample_ID , Temp , EC , pH , MF, Rho_Bf , SC , RPM_600 , RPM_300 , RPM_200 , RPM_100
153
)
1218 D e a l l o c a t e ( RPM_60 , RPM_30 , RPM_6 , RPM_3 , Gel10s , Gel10min )
1219
1220 D e a l l o c a t e ( A c t i v i t y , Joint_MP , Length_MP )
1221
1222 I f ( L o c a t i o n == ’ Den H e l d e r ’ ) D e a l l o c a t e ( P_Max1 , P_Max2 , P_Calc , P _ R e a l )
1223 I f ( L o c a t i o n == ’ T e x e l ’ ) D e a l l o c a t e ( P_Real , P_Min )
1224
1225 I f ( RunOption == 2 ) W r i t e ( * , ’ (A) ’ ) " Check Z1 "
1226
1227 D e a l l o c a t e ( PumpTimesAll , T i m e I n t A v A l l )
1228 D e a l l o c a t e ( SourceLocAvAll , P o s i t i o n B i t A l l , Tau_Yield_HB_Tot , K_Tot , n _ T o t )
1229 D e a l l o c a t e ( PV_Tot , YP_Tot , Alpha_Tot , Delta_Tot_HB , Delta_Tot_BH )
1230 D e a l l o c a t e ( Mud_P_Tot , MaxPlugR_Tot )
1231
1232 I f ( RunOption == 2 ) W r i t e ( * , ’ (A) ’ ) " Check Z2 "
1233
1234 D e a l l o c a t e ( S a m p l i n g D e p t h T o t , SamplingAwayTot , S a m p l i n g R i g h t T o t )
1235 D e a l l o c a t e ( S o u r c e D e p t h T o t , SourceAwayTot , S o u r c e R i g h t T o t )
1236
1237 I f ( RunOption == 2 ) W r i t e ( * , ’ (A) ’ ) " Check Z3 "
1238
1239 D e a l l o c a t e ( Sieve_Code , D)
1240 ! D e a l l o c a t e ( Sieve_Code_V , D_V)
1241
1242 D e a l l o c a t e ( D_Max_Tot )
1243 D e a l l o c a t e ( AverageV_Tot , MaxV_Tot )
1244 Deallocate ( InfiltrationLossBTL_BH_Tot , InfiltrationLossBTL_HB_Tot )
1245 Deallocate ( InfilLossPerc_BH_Tot , InfilLossPerc_HB_Tot )
1246 D e a l l o c a t e ( Max_D_BH_Tot , v _ s e t t l e _ B H _ T o t )
1247 D e a l l o c a t e ( Gamma_Ann_Tot1 )
1248 D e a l l o c a t e ( Gamma_Ann_Tot2 )
1249 D e a l l o c a t e ( Re_Gen_BH_Tot , Re_Gen_HB_Tot )
1250 D e a l l o c a t e ( DmaxTrMinBH_Tot , DmaxTrMinHB_Tot , DmaxTrMaxBH_Tot , DmaxTrMaxHB_Tot )
1251
1252 I f ( RunOption == 2 ) W r i t e ( * , ’ (A) ’ ) " Check Z4 "
1253
1254 W r i t e ( * , ’ (A) ’ ) " Check D e a l l o c a t i o n "
1255
1256 ! Closing Files
1257 ! −−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−
1258 Close ( InputDim )
1259 C l o s e ( InputCSV_PD )
1260 C l o s e ( InputCSV_Sur )
1261 C l o s e ( InputMP )
1262 Close ( SampleData )
1263 Close ( OutputLosses )
1264 Close ( OutputSamples )
1265 Close ( OutputSamplesLoc )
1266 Close ( O u t p u t F l u i d P r o p e r t i e s )
1267 Close ( OutputFluidPropTex )
1268 Close ( O u t p u t T r a n s p o r t P r o p e r t i e s )
1269 Close ( OutputTransportPropTex )
1270 Close ( OutputLosses )
1271 Close ( Si ev eRe su lts )
1272 ! Close ( SieveResults_V )
1273
1274 I f ( RunOption == 2 ) C l o s e ( T a b l e H a n s )
1275 I f ( RunOption == 2 ) W r i t e ( * , ’ (A) ’ ) " Check Z5 "
1276
1277 Close ( SampleSourceLog )
1278
1279 W r i t e ( * , ’ (A) ’ ) " Check C l o s i n g F i l e s "
1280
1281 ! −−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−
1282
1283 S e l e c t Case ( P r o g r a m O p t i o n )
1284
1285 Case ( 1 )
1286
1287 Write ( * , * )
154 E. Code of the SampleSource Program
Code/SampleSourceV1a.f90
1 Module S o u r c e M o d u l e
2
3 I m p l i c i t None
4
5 Contains
6
7 ! −−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−
8 ! FUNCTIONS
9 ! −−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−
10
11 I n t e g e r Function LineCount ( F i l e )
12 ! C a l c u l a t e s t h e amount o f l i n e s i n a f i l e
13 ! Based on h t t p : / / web . u t a h . edu / t h o r n e / c o m p u t i n g / H a n d y _ F o r t r a n _ T r i c k s . pdf , b o t t o m l a s t p a g e
14 ! See h t t p : / / s t a c k o v e r f l o w . com / q u e s t i o n s / 1 9 7 1 3 2 0 7 / u s i n g −do − l o o p − i n −a − f o r t r a n 9 0 − program − t o −
r e a d − d i f f e r e n t − number − of − l i n e s − f o r −n − f r a f o r how t o c h a n g e t o column c o u n t .
15 I m p l i c i t None
16
17 Integer :: File , nlines
18 Integer :: io
19
20 nlines = 0 ! Number o f l i n e s n e e d s a s t a r t v a l u e
21
22 Do
23 Read ( F i l e , * , IOSTAT= i o )
24 I f ( i o > 0 ) Then
25 W r i t e ( * , * ) " Check i n p u t . S o m e t h i n g i s wrong . . . "
26 Exit
156 E. Code of the SampleSource Program
96
97 End S e l e c t
98
99 End F u n c t i o n
100
101 ! −−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−
102
103 R e a l F u n c t i o n ReynoldsGen ( Rho_bf , D, v , t a u _ y i e l d , n , K)
104 ! G e n e r a l i z e d R e y n o l d s Number a p p l i c a b l e t o HB − e x t e n d e d , HB, PL , BH and N e w t o n i a n f l u i d s ,
Madlener2009 .
105 I m p l i c i t None
106
107 Real :: Rho_bf , D, v , t a u _ y i e l d , n , K, m
108
109 m = ( n * K * ( 8 . d0 * v / D) * * n ) / ( t a u _ y i e l d + K * ( 8 . d0 * v / D) * * n )
110
111 ReynoldsGen = ( Rho_bf * ( v * * ( 2 . d0 − n ) ) * (D* * n ) ) / ( ( t a u _ y i e l d / 8 . d0 ) * ( ( D / v ) * * n ) + K*
( ( ( 3 . d0 *m + 1 . d0 ) / ( 4 . d0 *m) ) * * n ) * ( 8 . d0 * * ( n − 1) ) )
112
113 End F u n c t i o n
114
115 ! −−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−
116 R e a l F u n c t i o n Hedstrom ( Rho_bf , D, Tau_Y , V i s c o s i t y )
117 ! The Hedstrom Number
118 I m p l i c i t None
119
120 Real :: Rho_bf , D, Tau_Y , V i s c o s i t y
121
122 Hedstrom = ( Rho_bf * Tau_Y * D * D) / ( V i s c o s i t y * V i s c o s i t y )
123
124 End F u n c t i o n
125
126 ! −−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−
127
128 R e a l F u n c t i o n M a x D i a m e t e r P l a s t i c i t y ( C1 , Tau_Y , g , Rho_bf , Rho_Grain )
129 ! Based on p l a s t i c i t y t h e o r y , 0 . 0 4 8 <= c1 <= 0 . 2
130 I m p l i c i t None
131
132 Real :: C1 , Rho_bf , Rho_Grain , Tau_Y , g
133
134 MaxDiameterPlasticity = ( c1 * Tau_Y ) / ( g * ( Rho_Grain − Rho_bf ) )
135
136 End F u n c t i o n
137
138 ! −−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−
139
140 R e a l F u n c t i o n S e t t l i n g V e l ( g , Rho_bf , R h o _ g r a i n , d , v i s c o s i t y , Tau_y )
141 ! Based on Wan 1985
142 I m p l i c i t None
143
144 Real :: g , Rho_bf , R h o _ g r a i n , d , v i s c o s i t y , Tau_y
145
146 SettlingVel = ( ( ( R h o _ g r a i n − Rho_bf ) * g * d * d ) / ( 1 8 * v i s c o s i t y ) ) * ( ( 7 * d * Tau_y ) /
(24 * v i s c o s i t y ) )
147
148 End F u n c t i o n
149
150 ! −−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−
151
152 R e a l F u n c t i o n GammaAnn1 ( v , D_bh )
153 ! Based on Denekamp 2000
154 I m p l i c i t None
155
156 Real :: v , D_bh
157 Real :: R_fac
158
159 R_fac = 1 . 5 d0 ! V a l u e f o u n d i n Denekamp 2000
160
161 GammaAnn1 = R _ f a c * ( ( 8 * v ) / D_bh )
162
163 End F u n c t i o n
158 E. Code of the SampleSource Program
164
165 ! −−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−
166
167 R e a l F u n c t i o n GammaAnn2 ( v , D_bh , D_ds )
168 ! Based on Mendes 2005
169 I m p l i c i t None
170
171 Real :: v , D_bh , D_ds , Ro , Ri
172
173 Ro = D_bh / 2 . d0
174 Ri = D_ds / 2 . d0
175
176 GammaAnn2 = v / ( Ro − Ri )
177
178 End F u n c t i o n
179
180 ! −−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−
181 ! SUBROUTINES
182 ! −−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−
183 ! Common , n o t p r o g r a m s p e c i f i c
184 ! −−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−
185
186 S u b r o u t i n e W r i t e L o g ( W r i t e O p t i o n , Message , L o g f i l e 1 , L o g f i l e 2 , L o g f i l e 3 )
187 ! D e p e n d i n g on t h e w r i t e o p t i o n i t w r i t e s m e s s a g e s t o t h e s c r e e n ( 1 ) , s c r e e n and up t o t h r e e
l o g f i l e s ( 2 ) o r j u s t t o up t o t h r e e l o g f i l e s ( 3 ) .
188 I m p l i c i t None
189
190 Integer :: WriteOption
191 Character (5) :: WFormat
192 Character (*) :: Message
193 Integer , optional :: Logfile1 , Logfile2 , Logfile3
194
195 WFormat = ’ (A) ’
196
197 S e l e c t Case ( W r i t e O p t i o n )
198
199 Case ( 1 )
200 W r i t e ( * , WFormat ) t r i m ( Message )
201
202 Case ( 2 )
203 W r i t e ( * , WFormat ) t r i m ( Message )
204
205 I f ( p r e s e n t ( L o g f i l e 1 ) ) Then
206 W r i t e ( L o g f i l e 1 , WFormat ) t r i m ( Message )
207 Write ( Logfile1 , * )
208 End I f
209
210 I f ( p r e s e n t ( L o g f i l e 2 ) ) Then
211 W r i t e ( L o g f i l e 2 , WFormat ) t r i m ( Message )
212 Write ( Logfile2 , * )
213 End I f
214
215 I f ( p r e s e n t ( L o g f i l e 3 ) ) Then
216 W r i t e ( L o g f i l e 3 , WFormat ) t r i m ( Message )
217 Write ( Logfile3 , * )
218 End I f
219
220 Case ( 3 )
221 I f ( p r e s e n t ( L o g f i l e 1 ) ) Then
222 W r i t e ( L o g f i l e 1 , WFormat ) t r i m ( Message )
223 Write ( Logfile1 , * )
224 End I f
225
226 I f ( p r e s e n t ( L o g f i l e 2 ) ) Then
227 W r i t e ( L o g f i l e 2 , WFormat ) t r i m ( Message )
228 Write ( Logfile2 , * )
229 End I f
230
231 I f ( p r e s e n t ( L o g f i l e 3 ) ) Then
232 W r i t e ( L o g f i l e 3 , WFormat ) t r i m ( Message )
233 Write ( Logfile3 , * )
159
234 End I f
235
236 Case D e f a u l t
237 W r i t e ( * , ’ (A) ’ ) " The W r i t e o p t i o n i s unknown . "
238
239 End S e l e c t
240
241 End S u b r o u t i n e
242
243 ! −−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−
244 ! Reading f i l e s
245 ! −−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−
246
247 S u b r o u t i n e ReadingFileCSV_PD ( F i l e , DateTime_PD , Bit_DPT , Hol_DPT , Car_POS , Car_SPD , P u l l , Push ,
Torq_pos , Rot_SPD , M_Press , MudFlw , Torq_neg , P r e s s _ 1 , P r e s s _ 2 , P r e s s _ 3 , HS_D , N l i n e s _ P D )
248 ! C o n t a i n i n g h e a d e r , 1 s t column i s d a t e and t i m e ( dd −mm− yyyy hh :mm: s s f o r m a t ) , j u s t r e a l
numbers t h e o t h e r c o l u m n s . Columns s e p a r a t e d by " , " .
249 I m p l i c i t None
250
251 Integer :: File
252 Character (100) :: Header
253 Character (19) , allocatable : : DateTime_PD ( : ) , Time ( : )
254 Integer , allocatable : : Bit_DPT ( : ) , Hol_DPT ( : ) , Car_POS ( : ) , Car_SPD ( : ) , P u l l ( : ) , Push ( : ) ,
Torq_pos ( : )
255 Integer , allocatable : : Rot_SPD ( : ) , M_Press ( : ) , MudFlw ( : ) , T o r q _ n e g ( : ) , P r e s s _ 1 ( : ) ,
P r e s s _ 2 ( : ) , P r e s s _ 3 ( : ) ,HS_D ( : )
256 Integer :: n l i n e s , i , io , n l i n e s _ d a t a , Nlines_PD
257 Character (1000) :: Message
258 Integer :: S a m p l e S o u r c e L o g =25
259
260 n l i n e s = LINECOUNT ( F i l e )
261
262 n l i n e s _ d a t a = n l i n e s −1 ! File contains headers .
263
264 A l l o c a t e ( DateTime_PD ( n l i n e s _ d a t a ) )
265 A l l o c a t e ( Time ( n l i n e s _ d a t a ) )
266 A l l o c a t e ( Bit_DPT ( n l i n e s _ d a t a ) )
267 A l l o c a t e ( Hol_DPT ( n l i n e s _ d a t a ) )
268 A l l o c a t e ( Car_POS ( n l i n e s _ d a t a ) )
269 A l l o c a t e ( Car_SPD ( n l i n e s _ d a t a ) )
270 Allocate ( Pull ( nlines_data ) )
271 A l l o c a t e ( Push ( n l i n e s _ d a t a ) )
272 A l l o c a t e ( Torq_pos ( n l i n e s _ d a t a ) )
273 A l l o c a t e ( Rot_SPD ( n l i n e s _ d a t a ) )
274 A l l o c a t e ( M_Press ( n l i n e s _ d a t a ) )
275 A l l o c a t e ( MudFlw ( n l i n e s _ d a t a ) )
276 A l l o c a t e ( Torq_neg ( n l i n e s _ d a t a ) )
277 Allocate ( Press_1 ( nlines_data ) )
278 Allocate ( Press_2 ( nlines_data ) )
279 Allocate ( Press_3 ( nlines_data ) )
280 A l l o c a t e ( HS_D ( n l i n e s _ d a t a ) )
281
282 Read ( f i l e , ’ ( A100 ) ’ ) Header
283
284 Do i =1 , n l i n e s _ d a t a
285 Read ( f i l e , * , IOSTAT= i o ) DateTime_PD ( i ) , Time ( i ) , Bit_DPT ( i ) , Hol_DPT ( i ) , Car_POS ( i ) , Car_SPD (
i ) , P u l l ( i ) , Push ( i ) , T o r q _ p o s ( i ) , Rot_SPD ( i ) , M_Press ( i ) , MudFlw ( i ) , T o r q _ n e g ( i ) , P r e s s _ 1 ( i ) ,
P r e s s _ 2 ( i ) , P r e s s _ 3 ( i ) ,HS_D ( i )
286 DateTime_PD ( i ) = t r i m ( a d j u s t l ( DateTime_PD ( i ) ) ) / / ’ ’ / / t r i m ( a d j u s t l ( Time ( i ) ) ) !
Space i s counted as s e p e r a t o r as w e l l . . .
287
288 I f ( i o > 0 ) Then
289 W r i t e ( * , * ) " Check i n p u t , s o m e t h i n g i s wrong , u n i t w i s e . . . "
290 W r i t e ( * , * ) " Check f i l e f o r h e a d e r s , P r o d a t a p u t s one e v e r y t i m e t h e r i g ( r e ) s t a r t s . "
291 Exit
292 E l s e i f ( i o < 0 ) Then
293 W r i t e ( * , * ) " End o f f i l e i s r e a c h e d , b e f o r e end o f l o o p . "
294 Exit
295 End I f
296 End Do
297
160 E. Code of the SampleSource Program
a re found . "
363 C a l l W r i t e L o g ( 1 , t r i m ( Message ) )
364
365 D e a l l o c a t e ( D a t e _ I , Time_R )
366
367 End S u b r o u t i n e
368
369 ! −−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−
370
371 S u b r o u t i n e R e a d i n g F i l e S a m p l e D a t a ( L o c a t i o n , F i l e , No_Samples , DateTime_Samples , Sample_ID , Temp , EC ,
pH , MF, Rho , SC , RPM_600 , RPM_300 , RPM_200 , RPM_100 , RPM_60 , RPM_30 , RPM_6 , RPM_3 , Gel10s , Gel10min )
372 ! C o n t a i n i n g h e a d e r , 1 s t column d a t e ( dd −mm− yy ) , 2 nd column t i m e ( hh :mm) , j u s t r e a l numbers
t h e o t h e r columns , b e s i d e s number 11 which c o n t a i n s i n t e g e r s . Columns s e p a r a t e d by " , " .
373 I m p l i c i t None
374
375 Integer :: File
376 Character (130) :: Header
377 Integer , Allocatable :: Date_I ( : )
378 Real , Allocatable : : Time_R ( : )
379 Integer :: n l i n e s , i , i o , n l i n e s _ d a t a , No_Samples
380 Character (19) , Allocatable :: DateTime_Samples ( : )
381 Character ( len =:) , Allocatable :: Sample_ID ( : )
382 Real , Allocatable : : Temp ( : ) ,EC ( : ) , pH ( : ) ,MF ( : ) , Rho ( : ) , SC ( : )
383 Integer , Allocatable : : RPM_600 ( : ) , RPM_300 ( : ) , RPM_200 ( : ) , RPM_100 ( : ) , RPM_60 ( : ) ,
RPM_30 ( : ) ,RPM_6 ( : ) ,RPM_3 ( : ) , G e l 1 0 s ( : ) , Gel10min ( : )
384 Character (10) :: Location
385 Character (1000) :: Message
386
387 n l i n e s = LINECOUNT ( F i l e )
388
389 n l i n e s _ d a t a = n l i n e s −1 ! File contains headers .
390
391 Allocate ( Date_I ( n l i n e s _ d a t a ) )
392 A l l o c a t e ( Time_R ( n l i n e s _ d a t a ) )
393
394 S e l e c t Case ( L o c a t i o n )
395 Case ( ’ Den H e l d e r ’ )
396 Allocate ( character (14) : : Sample_ID ( n l i n e s _ d a t a ) )
397 Case ( ’ T e x e l ’ )
398 Allocate ( character (11) : : Sample_ID ( n l i n e s _ d a t a ) )
399 Case D e f a u l t
400 W r i t e ( * , ’ (A) ’ ) " L o c a t i o n i s unknown , p r o g r a m i s t e r m i n a t e d . "
401 Pause
402 Stop
403 End S e l e c t
404
405 A l l o c a t e ( Temp ( n l i n e s _ d a t a ) )
406 A l l o c a t e ( EC ( n l i n e s _ d a t a ) )
407 A l l o c a t e ( pH ( n l i n e s _ d a t a ) )
408 A l l o c a t e (MF( n l i n e s _ d a t a ) )
409 A l l o c a t e ( Rho ( n l i n e s _ d a t a ) )
410 A l l o c a t e ( SC ( n l i n e s _ d a t a ) )
411 A l l o c a t e ( RPM_600 ( n l i n e s _ d a t a ) )
412 A l l o c a t e ( RPM_300 ( n l i n e s _ d a t a ) )
413 A l l o c a t e ( RPM_200 ( n l i n e s _ d a t a ) )
414 A l l o c a t e ( RPM_100 ( n l i n e s _ d a t a ) )
415 A l l o c a t e ( RPM_60 ( n l i n e s _ d a t a ) )
416 A l l o c a t e ( RPM_30 ( n l i n e s _ d a t a ) )
417 A l l o c a t e ( RPM_6 ( n l i n e s _ d a t a ) )
418 A l l o c a t e ( RPM_3 ( n l i n e s _ d a t a ) )
419 A l l o c a t e ( Gel10s ( n l i n e s _ d a t a ) )
420 A l l o c a t e ( Gel10min ( n l i n e s _ d a t a ) )
421
422 Read ( f i l e , ’ ( A100 ) ’ ) Header
423
424 Do i =1 , n l i n e s _ d a t a
425 Read ( f i l e , ’ ( I5 , 1 x , F17 . 1 5 , 1 x , A, 1 x , 3 ( F5 . 2 , 1 x ) , F6 . 2 , 1 x , 2 ( F5 . 2 , 1 x ) , 1 0 ( I ) ) ’ , IOSTAT= i o ) D a t e _ I (
i ) , Time_R ( i ) , Sample_ID ( i ) , Temp ( i ) ,EC ( i ) , pH ( i ) ,MF( i ) , Rho ( i ) , SC ( i ) , RPM_600 ( i ) , RPM_300 ( i ) ,
RPM_200 ( i ) , RPM_100 ( i ) , RPM_60 ( i ) , RPM_30 ( i ) ,RPM_6 ( i ) ,RPM_3 ( i ) , G e l 1 0 s ( i ) , Gel10min ( i )
426
427 I f ( i o > 0 ) Then
162 E. Code of the SampleSource Program
494 Nlines_MP = n l i n e s _ d a t a
495
496 End S u b r o u t i n e
497
498 ! −−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−
499
500 S u b r o u t i n e R e a d i n g F i l e S i e v e ( F i l e , Sample_Code , D)
501 ! Reads t h e s i e v e f i l e , c a n be g e n e r a l i z e d t o be a p p l i c a b l e t o f i l e s w i t h v a r i a b l e p a r a m e t e r
lengths .
502 I m p l i c i t None
503
504 Integer :: File
505 Integer :: n l i n e s , n l i n e s _ d a t a , i , io , j
506 Character (31) , Allocatable :: GefFileName ( : )
507 Character (7) , Allocatable :: Boring_Code ( : )
508 Character (3) , Allocatable : : NEN5104_Code ( : )
509 Character (7) , Allocatable : : Sample_No ( : )
510 Character (14) , Allocatable : : Sample_Code ( : )
511 Character (17) , Allocatable :: Depth ( : )
512 Character (1) :: lineTemp
513 Character (2048) :: Line
514 Integer : : Posmin , Posmax , Pos
515 Character (40) , Allocatable : : Var ( : )
516 Character :: Separator
517 Integer : : nColumns
518 Character (2) : : Number
519 Character (7) : : Code
520 Real , Allocatable : : D( : , : )
521 Integer : : count
522
523 n l i n e s = LineCount ( F i l e )
524 n l i n e s _ d a t a = n l i n e s −1 ! File contains headers .
525
526 A l l o c a t e (D( n l i n e s _ d a t a , 9 9 ) ) ! (y , x)
527
528 Separator = " , "
529 nColumns = ColumnCount ( F i l e , S e p a r a t o r )
530
531 W r i t e ( * , ’ (A, I10 , A) ’ ) ’ The S i e v e f i l e i s r e a d and ’ , n l i n e s _ d a t a , ’ l i n e s c o n t a i n i n g d a t a a r e
found . ’
532
533 A l l o c a t e ( Var ( nColumns ) )
534 A l l o c a t e ( GefFileName ( n l i n e s _ d a t a ) )
535 A l l o c a t e ( Boring_Code ( n l i n e s _ d a t a ) )
536 A l l o c a t e ( NEN5104_Code ( n l i n e s _ d a t a ) )
537 A l l o c a t e ( Sample_No ( n l i n e s _ d a t a ) )
538 A l l o c a t e ( Sample_Code ( n l i n e s _ d a t a ) )
539 A l l o c a t e ( Depth ( n l i n e s _ d a t a ) )
540
541 Read ( F i l e , ’ (A) ’ ) ! Skips headers
542
543 Do j = 1 , n l i n e s _ d a t a
544 Read ( F i l e , ’ (A) ’ ) L i n e
545
546 posmin = 1
547 posmax = −1
548 Count = 0
549
550 Do i =1 , nColumns
551
552 Pos = i n d e x ( L i n e ( Posmin : ) , " , " )
553 I f ( Pos == 0 ) Then
554 Var ( i ) = L i n e ( Posmin : )
555 Exit
556 End I f
557
558 Count = c o u n t + 1
559
560 I f ( Count == 5 ) e x i t
561
562 Posmax = Posmax + Pos
164 E. Code of the SampleSource Program
634 Return
635 Else
636 Read ( Value , ’ ( I 2 . 2 , 1 x , I 2 . 2 , 1 x , I4 , 1 x , I 2 . 2 , 1 x , I 2 . 2 , 1 x , I 2 . 2 ) ’ ) Day_v , Month_v , Year_v ,
Hours_v , M i n u t e s _ v , S e c o n d s _ v
637 Read ( A r r a y ( I n d e x ) , ’ ( I 2 . 2 , 1 x , I 2 . 2 , 1 x , I4 , 1 x , I 2 . 2 , 1 x , I 2 . 2 , 1 x , I 2 . 2 ) ’ ) Day_a , Month_a ,
Year_a , Hours_a , M i n u t e s _ a , S e c o n d s _ a
638
639 I f ( Day_v == Day_a . and . Month_v == Month_a . and . Year_v == Y e a r _ a . and . Hours_v ==
H o u r s _ a . and . M i n u t e s _ v == M i n u t e s _ a . and . S e c o n d s _ v <= S e c o n d s _ a ) Then
640 W r i t e ( Message , ’ (A, A, I7 , A, A19 , A) ’ ) Value , " i s n o t e x a c t l y f o u n d b u t a t p o s i t i o n " ,
Index , " , " , Array ( Index ) , " i s found . "
641 C a l l W r i t e L o g ( 1 , t r i m ( Message ) , S a m p l e S o u r c e L o g )
642 Return
643 End I f
644 End I f
645 End Do
646
647 W r i t e ( Message , ’ (A, A, A) ’ ) " E r r o r : " , Value , " i s n o t f o u n d i n g i v e n a r r a y . " ! Outside
t h e do l o o p o r e v e r y do would p r i n t t h i s t o t h e s c r e e n b e f o r e c o n t i n u i n g .
648 C a l l W r i t e L o g ( 1 , t r i m ( Message ) , S a m p l e S o u r c e L o g )
649 W r i t e ( Message , ’ (A) ’ ) " T h i s w i l l be due t o a m i s s i n g d a t a p a c k a g e , s w i t c h i n g t o method 2 .
"
650 C a l l W r i t e L o g ( 1 , t r i m ( Message ) , S a m p l e S o u r c e L o g )
651
652 C a l l F i n d A p p r o x D a t e T i m e ( Value , Array , I n d e x )
653
654 End S u b r o u t i n e
655
656 ! −−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−
657
658 S u b r o u t i n e F i n d A p p r o x D a t e T i m e ( Value , Array , I n d e x )
659 ! C o n t r a r y t o t h e o t h e r r o u t i n e t h i s one i s b a s e d on f i n d i n g t h e minimum t i m e i n t e r v a l
b e t w e e n two d a t e t i m e v a l u e s
660 I m p l i c i t None
661
662 Character (19) :: Array ( : )
663 Character (19) :: Value
664 Integer :: Index , i , j
665 Integer :: TimeInt
666 Character (1000) :: Message
667 Integer :: S a m p l e S o u r c e L o g =25
668
669 Write ( * , * ) ! I n s e r t s an empty l i n e f o r e a s i e r r e a d i n g
670
671 Do i =1 ,60 ! D e v i a t i o n l o o p , maximum 1 h o u r and j u s t t a k e s t h e c l o s e s t
s i n c e TimeIntervalTwoValues r e t u r n s t h e a b s o l u t d i f f e r e n c e i n seconds , so found v a l u e can
be h i g h e r o r l o w e r t h a n i n i t i a l v a l u e b u t i t i s t h e c l o s e s t .
672 Do j =1 , s i z e ( A r r a y ) ! Array loop , c y c l e s t h r o u g h t h e a r r a y f o r t h e given d e v i a t i o n
673
674 C a l l T i m e I n t e r v a l T w o V a l u e s ( T i m e I n t , Value , A r r a y ( j ) )
675
676 I f ( T i m e I n t <= ( i * 6 0 ) ) Then
677 W r i t e ( Message , ’ (A, A, A, I2 , A) ’ ) " The c l o s e s t t o v a l u e " , Value , " , minimum
d e v i a t i o n of " , i , " minutes , "
678 C a l l W r i t e L o g ( 1 , t r i m ( Message ) , SampleSourceLog )
679 W r i t e ( Message , ’ (A, A, A, I 6 . 6 ) ’ ) " i s f o u n d t o be " , Array ( j ) , " a t index " , j
680 C a l l W r i t e L o g ( 1 , t r i m ( Message ) , SampleSourceLog )
681 Index = j
682 Return
683 End I f
684 End Do
685 End Do
686
687 W r i t e ( Message , ’ (A, I3 , A) ’ ) "No s o l u t i o n i s f o u n d w i t h i n a maximum d e v i a t i o n o f " , i , " m i n u t e s . "
688 Index = 0
689
690 C a l l W r i t e L o g ( 1 , t r i m ( Message ) , S a m p l e S o u r c e L o g )
691
692 End S u b r o u t i n e
693
694 ! −−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−
166 E. Code of the SampleSource Program
826
827 End S u b r o u t i n e
828
829 ! −−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−
830
831 S u b r o u t i n e SecToTimeI ( TimeInS , HH,MM, SS )
832 ! C a l c u l a t e s t h e t i m e i n s e c o n d s t o HH:MM: SS
833 I m p l i c i t None
834
835 Integer :: TimeInS
836 Integer :: HH,MM, SS
837
838 HH = i n t ( TimeInS / 3 6 0 0 )
839 MM = i n t ( ( TimeInS −HH* 3 6 0 0 ) / 6 0 )
840 SS = i n t ( TimeInS −HH* 3600 −MM* 6 0 )
841
842 End S u b r o u t i n e
843
844 ! −−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−
845
846 S u b r o u t i n e ZoomGPDays ( D a t e T i m e S o u r c e , DateTimeMin , DateTimeMax , X)
847 ! C a l c u l a t e s t h e t i m e min and max b a s e d on i n t e r v a l o f X d a y s
848 I m p l i c i t None
849
850 Character (19) :: D a t e T i m e S o u r c e , DateTimeMin , DateTimeMax
851 Integer :: X
852 Integer (2) :: Day , Day_Min , Day_Max
853 Integer (2) :: Month , Month_Min , Month_Max
854 Integer (4) :: Year
855 Integer (2) :: Hours , M i n u t e s , S e c o n d s
856
857 Read ( D a t e T i m e S o u r c e , ’ ( I2 , 1 x , I2 , 1 x , I4 , 1 x , I2 , 1 x , I2 , 1 x , I 2 ) ’ ) Day , Month , Year , Hours , M i n u t e s ,
Seconds
858
859 Day_Min = Day − X
860 Month_Min = Month
861
862 ! Day_Min c a n become 0 o r l e s s s o t h a n t h e month h a s t o be r e d u c e d and day_min becomes t h e
l a s t o r t h e x t o l a s t day o f t h a t month .
863 I f ( Day_Min < 1 ) Then
864 I f ( ( Month − 1) == 1 . o r . ( Month − 1) == 3 . o r . ( Month − 1) == 5 . o r . ( Month − 1) == 7 . o r . (
Month − 1) == 8 . o r . ( Month − 1) == 10 . o r . ( Month − 1) == 1 2 ) Then
865 Day_Min = 31 − Day_Min
866 Month_Min = Month − 1
867 E l s e I f ( ( Month − 1) == 4 . o r . ( Month − 1) == 6 . o r . ( Month − 1) == 9 . o r . ( Month − 1) == 1 1 )
Then
868 Day_Min = 30 − Day_Min
869 Month_Min = Month − 1
870 E l s e I f ( ( Month − 1) == 2 ) Then
871 Day_Min = 28 − Day_Min
872 Month_Min = Month − 1
873 End I f
874 End I f
875
876 W r i t e ( DateTimeMin , ’ ( I 2 . 2 , A1 , I 2 . 2 , A1 , I4 , 1 x , I 2 . 2 , A1 , I 2 . 2 , A1 , I 2 . 2 ) ’ ) Day_Min , " − " , Month_Min , " − " ,
Year , Hours , " : " , M i n u t e s , " : " , S e c o n d s
877 W r i t e ( * , * ) DateTimeMin
878
879 Day_Max = Day + X
880 Month_Max = Month
881
882 I f ( Day_Max > 3 1 ) Then
883 I f ( ( Month ) == 1 . o r . ( Month ) == 3 . o r . ( Month ) == 5 . o r . ( Month ) == 7 . o r . ( Month ) == 8
. o r . ( Month ) == 10 . o r . ( Month ) == 1 2 ) Then
884 Day_Max = Day_Max − 31
885 Month_Max = Month + 1
886 E l s e I f ( ( Month ) == 4 . o r . ( Month ) == 6 . o r . ( Month ) == 9 . o r . ( Month ) == 1 1 ) Then
887 Day_Max = Day_Max − 30
888 Month_Max = Month + 1
889 E l s e I f ( ( Month ) == 2 ) Then
890 Day_Max = Day_Max − 28
169
1023 End I f
1024
1025 T i m e I n t ( j ) = ( ( ( Month ( j ) − Month ( j − 1) ) * ( DaysMonth * 24 * 60 * 6 0 ) ) + ( ( Day ( j ) −Day ( j − 1) ) * ( 2 4 * 60 * 6 0 ) )
+ ( ( Hours ( j ) − Hours ( j − 1) ) * ( 6 0 * 6 0 ) ) + ( ( M i n u t e s ( j ) − M i n u t e s ( j − 1) ) * 6 0 ) + ( S e c o n d s ( j ) − S e c o n d s ( j − 1) )
)
1026 I f ( T i m e I n t ( j ) >= ( 1 2 * 60 * 6 0 ) ) Then ! S e c u r i t y measure f o r t h e f a c t t h a t t h e
d r i l l i n g was i n 12 h o u r s s h i f t s most o f t h e t i m e . An i n t e r v a l o f 12+ h o u r s w i l l c a u s e
d e v a t i o n s f u r t h e r on i n t h e p r o g r a m .
1027 T i m e I n t ( j ) = T i m e I n t ( j ) − ( 1 2 * 60 * 6 0 )
1028 End I f
1029 I f ( T i m e I n t ( j ) >= ( 1 0 * 6 0 ) ) Then ! S e c u r i t y measure f o r t h e f a c t t h a t sometimes
d a t a i n p a c k a g e s o f 10 min . i s m i s s i n g .
1030 TimeInt ( j ) = (5 * 60) ! Not e n t i r e l y t r u e , c a n c a u s e a s l i g h t
d e v i a t i o n i n t h e t r a v e l t i m e and t h u s i n t h e s o u r c e l o c a t i o n .
1031 End I f ! I t now t a k e s 5 m i n u t e s i n s t e a d o f 10 m i n u t e s
o f w h a t e v e r i t was d o i n g ( f u l l pumping − no pumping ) a t t h e moment t h e i n t e r v a l STOPS ,
s i n c e t h e Pumped volume i s b a c k c a l c u l a t e d .
1032 ! F o r two m i s s i n g d a t a p a c k a g e s i n a row
(08 − 09 − 2015 0 8 : 1 4 − 0 8 : 3 4 ) t h e d e v a t i o n i s o f c o u r s e l a r g e r .
1033 End Do
1034
1035 End S u b r o u t i n e
1036
1037 ! −−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−
1038
1039 S u b r o u t i n e T i m e I n t e r v a l T w o V a l u e s ( T i m e I n t , DateTime1 , DateTime2 , O p t i o n )
1040 ! C a l c u l a t e s t h e t i m e i n t e r v a l s b e t w e e n two d a t e t i m e v a l u e s i n [ s ] , i n d e p e n d e n t o f which i s
larger .
1041 I m p l i c i t None
1042
1043 Integer :: TimeInt ! [s]
1044 Character (19) :: DateTime1 , DateTime2
1045 Integer (2) :: Day1 , Month1 , Hours1 , M i n u t e s 1 , S e c o n d s 1
1046 Integer (4) :: Year1
1047 Integer (2) :: Day2 , Month2 , Hours2 , M i n u t e s 2 , S e c o n d s 2
1048 Integer (4) :: Year2
1049 Integer :: C1 , C2 , C3 , C4 , C5 , C6
1050 Integer , Optional :: Option
1051
1052 C a l l D a t e T i m e I n t e g e r S i n g l e ( DateTime1 , Day1 , Month1 , Year1 , Hours1 , M i n u t e s 1 , S e c o n d s 1 )
1053 C a l l D a t e T i m e I n t e g e r S i n g l e ( DateTime2 , Day2 , Month2 , Year2 , Hours2 , M i n u t e s 2 , S e c o n d s 2 )
1054
1055 I f ( Month1 == 1 . o r . Month1 == 3 . o r . Month1 == 5 . o r . Month1 == 7 . o r . Month1 == 8 . o r .
Month1 ==10 . o r . Month1 == 1 2 ) Then ! Jan , Mar , May , J u l , Aug , Oct , Dec
1056 C2 = 31 * 24 * 60 * 60
1057 E l s e i f ( Month1 == 2 ) Then ! Feb
1058 C2 = 28 * 24 * 60 * 60
1059 Else ! Apr , Jun , Sep , Nov
1060 C2 = 30 * 24 * 60 * 60
1061 End i f
1062
1063 C3 = 24 * 60 * 60 ! Hours i n a day a r e c o n s t a n t , 24
1064 C4 = 60 * 60 ! M i n u t e s i n a h o u r a r e c o n s t a n t , 60
1065 C5 = 60 ! S e c o n d s i n a m i n u t e a r e c o n s t a n t , 60
1066
1067 I f ( P r e s e n t ( O p t i o n ) ) Then
1068 T i m e I n t = ( ( ( Month1 − Month2 ) * ( C2 ) ) + ( ( Day1 −Day2 ) * ( C3 ) ) + ( ( Hours1 − Hours2 ) * ( C4 ) ) + ( ( M i n u t e s 1 −
M i n u t e s 2 ) * C5 ) + ( Seconds1 − S e c o n d s 2 ) )
1069 Else
1070 T i m e I n t = a b s ( ( ( Month1 − Month2 ) * ( C2 ) ) + ( ( Day1 −Day2 ) * ( C3 ) ) + ( ( Hours1 − Hours2 ) * ( C4 ) ) + ( ( M i n u t e s 1
− M i n u t e s 2 ) * C5 ) + ( Seconds1 − S e c o n d s 2 ) )
1071 End I f
1072
1073 End S u b r o u t i n e
1074
1075 ! −−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−
1076
1077 S u b r o u t i n e GeometryBoreH ( PI , D_bh , D_ds , A_bh , A_ds , A _ a n n u l u s )
1078 ! C a l c u l a t e s the geometry
1079 I m p l i c i t None
1080
172 E. Code of the SampleSource Program
1081 Real ( 8 ) : : PI
1082 Real :: D_bh , D_ds
1083 Real :: A_bh , A_ds , A _ a n n u l u s
1084
1085 A_bh = P I / 4 * D_bh * * 2
1086 A_ds = P I / 4 * D_ds * * 2
1087 A_annulus = A_bh−A_ds
1088
1089 End S u b r o u t i n e
1090
1091 ! −−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−
1092 ! Calculations − Preparations
1093 ! −−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−
1094 ! Fluid Parameters
1095 ! −−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−
1096 ! Herschel −B u l k l e y
1097 ! −−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−
1098
1099 S u b r o u t i n e H e r s c h e l _ B u l k l e y (X, Y, T a u _ Y i e l d , K, n , Min_Alpha , Min_Delta , Sample_Code , MainI ,
C o n v e r s i o n _ D e g r _ P a , RPM_600 , RPM_300 , RPM_200 , RPM_100 , RPM_60 , RPM_30 , RPM_6 , RPM_3 , GammaY , Tau ,
Tau_Calc_All , Alpha_All , D e l t a _ A l l )
1100 ! Based on h t t p : / / www. eng . umd . edu / ~ nsw / c h b e 2 5 0 / s l o p e . htm , and i s u s e d t o r e p l a c e t h e
i n t e r c e p t and s l o p e f u n c t i o n a s f o u n d i n e x c e l .
1101 I m p l i c i t None
1102
1103 Integer : : RPM_600 ( : ) , RPM_300 ( : ) , RPM_200 ( : ) , RPM_100 ( : ) , RPM_60 ( : ) , RPM_30 ( : ) ,RPM_6 ( : ) ,
RPM_3 ( : )
1104 Real :: Conversion_Degr_Pa
1105 Integer :: MainI
1106 Real ( 8 ) : : X ( : ) ,Y ( : )
1107 Real : : K, n
1108 Real , D i m e n s i o n ( 2 0 ) : : K_All , n _ A l l
1109 Real :: A
1110 Real : : SumX , SumY
1111 Real : : SumXX, SumXY
1112 Real : : X_Average , Y_Average
1113 Integer :: i, j
1114 Integer :: Index
1115 Real :: Tau_Calc
1116 Real ( 8 ) , Dimension ( 2 0 ) :: Tau_Calc_All
1117 Real : : Min_Alpha
1118 Real :: Alpha ! S c a l i n g f a c t o r on t a u _ y i e l d t o d e t e r m i n e t h e
minimum d e l t a .
1119 Real ( 8 ) , Dimension ( 2 0 ) :: Alpha_All
1120 Real :: Min_Delta
1121 Real :: Delta ! D e v i a t i o n b e t w e e n t h e m e a s u r e d and c a l c u l a t e d
v a l u e s , sum ( ( t a u − t a u _ c a l c ) ^ 2 ) .
1122 Real ( 8 ) , Dimension ( 2 0 ) :: Delta_All
1123 Real ( 8 ) , Dimension ( 2 0 ) : : Tau
1124 Character (*) : : Sample_Code
1125 Real ( 8 ) , dimension ( 8 ) : : GammaY
1126 Real :: Tau_Yield
1127 Real , D i m e n s i o n ( 2 0 ) :: Tau_Yield_All
1128
1129 Tau ( 1 ) = ( RPM_3 ( MainI ) * Conversion_Degr_Pa )
1130 Tau ( 2 ) = ( RPM_6 ( MainI ) * Conversion_Degr_Pa )
1131 Tau ( 3 ) = ( RPM_30 ( MainI ) * Conversion_Degr_Pa )
1132 Tau ( 4 ) = ( RPM_60 ( MainI ) * Conversion_Degr_Pa )
1133 Tau ( 5 ) = ( RPM_100 ( MainI ) * Conversion_Degr_Pa )
1134 Tau ( 6 ) = ( RPM_200 ( MainI ) * Conversion_Degr_Pa )
1135 Tau ( 7 ) = ( RPM_300 ( MainI ) * Conversion_Degr_Pa )
1136 Tau ( 8 ) = ( RPM_600 ( MainI ) * Conversion_Degr_Pa )
1137
1138 Delta = 0 . d0
1139 Do j = 1 , 2 0 ! Taking t a u _ y i e l d = 1* t a u _ y i e l d d i s t o r t s t h e r e s u l t s
1140 Alpha = j * 0 . 0 5 d0
1141 Tau_yield = Alpha * RPM_3 ( MainI ) * C o n v e r s i o n _ D e g r _ P a
1142
1143 Do i = 1 , s i z e (Y)
1144 I f ( ( Tau ( i ) − T a u _ y i e l d ) == 0 ) Then
1145 Y( i ) = 0 d0 ! TO BE DONE, d e c i d e w h e t h e r t h i s o r n o t t a k i n g i t i n t o
173
a c c o u n t i s more a c c u r a t e . . .
1146 Else
1147 Y( i ) = Log10 ( Tau ( i ) − T a u _ y i e l d )
1148 End I f
1149 End Do
1150
1151 SumX = 0 . d0
1152 SumY = 0 . d0
1153
1154 Do i =1 , S i z e (X)
1155 SumX = SumX + X( i )
1156 SumY = SumY + Y( i )
1157 SumXX = SumXX + X( i ) *X( i )
1158 SumXY = SumXY + X( i ) *Y( i )
1159 End Do
1160
1161 X_Average = SumX / f l o a t ( s i z e (X) )
1162 Y_Average = SumY / f l o a t ( s i z e (X) )
1163
1164 n = (SumXY − SumX* Y_Average ) / (SumXX − SumX* X_Average )
1165 A = Y_Average − n * X_Average
1166 K = 10 * *A
1167
1168 Delta = 0 ! R e s e t s t h e v a l u e from t h e p r e v i o u s l o o p , w / o i t t h e d e l t a
would o n l y i n c r e a s e
1169 Do i =1 , S i z e (GammaY)
1170 Tau_Calc = T a u _ Y i e l d + K*GammaY( i ) * * n
1171 Delta = Delta + ( Tau ( i ) − T a u _ C a l c ) * * 2 . d0
1172 End Do
1173
1174 K_All ( j ) = K
1175 n_All ( j ) = n
1176
1177 Tau_Yield_All ( j ) = Tau_Yield
1178 Delta_All ( j ) = Delta
1179 Alpha_All ( j ) = Alpha
1180 End Do
1181
1182 Index = Minloc ( D e l t a _ A l l , 1 )
1183 Min_Delta = Delta_All ( Index )
1184 Min_Alpha = Index * 0.05
1185
1186 K = K_All ( I n d e x )
1187 n = n_All ( Index )
1188 Tau_Yield = Tau_Yield_All ( Index )
1189
1190 Do i = 1 , s i z e (GammaY)
1191 Tau_Calc_All ( i ) = Tau_Yield_All ( Index ) + K_All ( I n d e x ) * GammaY( i ) * * n _ A l l ( I n d e x )
1192 End Do
1193
1194 ! C a l l f 2 g p 6 ( Sample_Code , GammaY , Tau , ’ 3 a ’ , GammaY , T a u _ C a l c _ A l l , ’ 3 b ’ , 1 , ’ S h e a r R a t e [ − ] ’ , ’ R e a d i n g
[ Pa ] ’ , ’ M e a s u r e m e n t s v s . C a l c u l a t e d ’ , ’ Measurements ’ , ’ C a l c u l a t e d ’ )
1195 ! C a l l f 2 g p 5 ( Sample_Code , A l p h a _ A l l , D e l t a _ A l l , ’ 2 a ’ , 1 , ’ Alpha [ − ] ’ , ’ D e l t a [ Pa ] ’ , ’ Alpha v s . D e l t a
’ , ’ Delta ’ )
1196
1197 End S u b r o u t i n e
1198
1199 ! −−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−
1200 ! Bingham
1201 ! −−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−
1202 S u b r o u t i n e Bingham ( MainI , PV , YP , RPM_600 , RPM_300 , C o n v e r s i o n _ D e g r _ l b , C o n v e r s i o n _ l b _ P a ,
Conversion_RPM_PerS , GammaY , Tau_Calc_BH , Tau , D e l t a )
1203 ! C a l c u l a t e s Bingham p a r a m e t e r s
1204 ! PV and YP a r e b o t h i n [ Pa ] , YP i s u s e d a s T a u _ y i e l d
1205 I m p l i c i t None
1206
1207 Integer : : RPM_600 ( : ) , RPM_300 ( : )
1208 Integer :: MainI
1209 Real : : PV , YP
1210 Real :: C o n v e r s i o n _ D e g r _ l b , C o n v e r s i o n _ l b _ P a , Conversion_RPM_PerS
1211 Real ( 8 ) , dimension ( 8 ) : : GammaY
174 E. Code of the SampleSource Program
1272
1273 TranspLenSum ( Index_PD ) = T r a n s p L e n ( Index_PD )
1274 Do i = 1 , ( Index_PD − 1)
1275 j = Index_PD − i
1276 TranspLenSum ( j ) = TranspLenSum ( j + 1 ) + T r a n s p L e n ( j )
1277 End Do
1278
1279 End S u b r o u t i n e
1280
1281 ! −−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−
1282
1283 S u b r o u t i n e F l u i d V e l o c i t y ( AverageV , MaxV , Index_PD , Index_Sol_PD , MudFlw , A_bh , L o s s )
1284 ! Calculates the fluid velocity
1285 I m p l i c i t None
1286
1287 Real , Allocatable :: V( : ) ! [m/ s ]
1288 Integer :: CountN0Arr
1289 Real :: AverageV , MaxV
1290 Integer :: MudFlw ( : ) ! [ L / min ]
1291 Real :: A_bh ! [ m2 ]
1292 Real :: Loss
1293 Integer :: i , Index_Sol_PD , Index_PD
1294
1295
1296 A l l o c a t e (V( Index_PD − I n d e x _ S o l _ P D + 1 ) )
1297
1298 CountN0Arr = 0
1299
1300 Do i = index_Sol_PD , Index_PD
1301 V( i +1− I n d e x _ S o l _ P D ) = ( ( MudFlw ( i ) / 1 0 0 0 . d0 / 6 0 . d0 ) * ( 1 . d0 − L o s s ) ) / A_bh
1302 I f (V( i +1− I n d e x _ S o l _ P D ) > 0 ) CountN0Arr = CountN0Arr + 1
1303 End Do
1304
1305 AverageV = Sum (V) / CountN0Arr
1306 MaxV = Maxval (V)
1307
1308 Write ( * , * )
1309 W r i t e ( * , ’ ( 2 ( A, I ) ) ’ ) " Index_Sol_PD , Index_PD : " , I n d e x _ S o l _ P d , " , " , Index_PD
1310 W r i t e ( * , ’ ( 3 ( A, F5 . 2 ) ) ’ ) " AverageV , MaxV , MinV : " , AverageV , " , " ,MaxV , " , " , M i n v a l (V)
1311 Write ( * , * )
1312
1313 End S u b r o u t i n e
1314
1315 ! −−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−
1316
1317 S u b r o u t i n e I n t e r s e c t i o n ( DateTime_PD , Index_PD , DateTime_Sur , I n d e x _ S u r , TranspLenSum ,MD,
Index_Sol_PD , I n d e x _ S o l _ S u r , S o u r c e L o c _ S u r , SourceLoc_PD , SourceLocAv , DateTimeSample )
1318 ! F i n d s t h e v a l u e s from t h e P r o D a t a d a t a and d e r i v e d d a t a a t t h e t i m e s o f t h e S u r v e y f i l e .
1319 I m p l i c i t None
1320
1321 Integer :: h , i , j , k , l , z , Index_PD , I n d e x _ S u r
1322 Real ( 8 ) :: MD( : )
1323 Real ( 8 ) :: TranspLenSum ( : )
1324 Character (19) :: DateTime_PD ( : )
1325 Character (19) :: DateTime_Sur ( : )
1326 Integer :: Index_Sol_PD , I n d e x _ S o l _ S u r
1327 Real :: Deviation
1328 Real :: SourceLoc_PD , S o u r c e L o c _ S u r
1329 Real :: SourceLoc
1330 Character (19) :: DateTimeSample
1331 Real :: SourceLocAV , SourceLocAV1 , SourceLocAV2
1332 Integer (2) , Allocatable :: Day_Sur ( : ) , Month_Sur ( : ) , H o u r s _ S u r ( : ) , M i n u t e s _ S u r ( : ) , S e c o n d s _ S u r
(:)
1333 Integer (4) , Allocatable :: Year_Sur ( : )
1334 Integer (2) , Allocatable :: Day_PD ( : ) , Month_PD ( : ) , Hours_PD ( : ) , Minutes_PD ( : ) , Seconds_PD ( : )
1335 Integer (4) , Allocatable :: Year_PD ( : )
1336 Integer :: HH1 ,MM1, SS1 , HH2 ,MM2, SS2
1337
1338 C a l l D a t e T i m e I n t e g e r A r r a y ( DateTime_Sur , Day_Sur , Month_Sur , Year_Sur , Hours_Sur , M i n u t e s _ S u r ,
Seconds_Sur )
1339 C a l l D a t e T i m e I n t e g e r A r r a y ( DateTime_PD , Day_PD , Month_PD , Year_PD , Hours_PD , Minutes_PD , Seconds_PD )
176 E. Code of the SampleSource Program
1340
1341 ! Approach 1 − Making a l i s t o f I n d e x numbers c o n n e c t i n g t h e v a l u e s from t h e S u r f i l e t o
c e r t a i n v a l u e s from t h e PD D a t a and d e r i v e d v a l u e s .
1342
1343 ! A l l o c a t e ( IndexSurPD ( I n d e x _ S u r ) )
1344 !
1345 ! z =1
1346 ! Do i =1 , I n d e x _ S u r
1347 ! Do j =1 , Index_PD
1348 ! I f ( Day_Sur ( i ) == Day_PD ( j ) . and . Month_Sur ( i ) == Month_PD ( j ) . and . Y e a r _ S u r ( i ) ==
Year_PD ( j ) . and . H o u r s _ S u r ( i ) == Hours_PD ( j ) . and . M i n u t e s _ S u r ( i ) == Minutes_PD ( j ) ) Then
1349 ! I f ( S e c o n d s _ S u r ( i ) == Seconds_PD ( j ) . o r . ( S e c o n d s _ S u r ( i ) + 1 ) == Seconds_PD ( j ) . o r
. ( S e c o n d s _ S u r ( i ) + 2 ) == Seconds_PD ( j ) ) Then
1350 ! ! IndexSurPD ( i ) = j ! R e s u l t s i n IndexSurPD = 0 , a l l e n t r i e s
1351 ! ! or
1352 ! IndexSurPD ( z ) = j ! R e s u l t s i n IndexSurPD = − 116300599 , a l l e n t r i e s .
IndexSurPD ( z ) = z f o r some r e a s o n g i v e s t h e same r e s u l t . . .
1353 ! z=z +1
1354 ! W r i t e ( * , * ) IndexSurPD ( z ) , i , j , Day_Sur ( i ) , Day_PD ( j ) , M i n u t e s _ S u r ( i ) ,
Minutes_PD ( j ) , S e c o n d s _ S u r ( i ) , Seconds_PD ( j )
1355 ! End I f
1356 ! End I f
1357 ! End Do
1358 ! End Do
1359
1360 ! Approach 3 − ( Approach 2 was f a i r l y s i m i l a i r b u t b a s e d on i n t e r p o l a t i o n t o r e f i n e t h e
s o u r c e l o c a t i o n . a p p r o a c h 3 t a k e s t h e a v e r a g e o f t h e 2 s o l u t i o n s f o u n d . See comments . )
1361
1362 Write ( * , * ) ! I n s e r t s an empty l i n e f o r e a s i e r r e a d i n g
1363 D e v i a t i o n = 0 . 1 d0
1364 Do h =1 ,999 ! D e v i a t i o n l o o p , i f e x a c t match i s f o u n d s o l u t i o n i t won ’ t
be u s e d
1365 Do i =1 , I n d e x _ S u r ! S u r v e y b a s e d l o o p , c h a n g e s t h e s u r v e y t i m e and d a t e t o
t h e n e x t v a l u e i s no s o l u t i o n i s f o u n d
1366 k = I n d e x _ S u r +1− i
1367 Do j =1 , Index_PD ! P r o d a t a loop , l o o k e s t o a l l t h e P r o d a t a d a t a t o f i n d t h e
same v a l u e a t t h e g i v e n S u r v e y t i m e .
1368 l = Index_PD+1− i
1369 I f ( Day_Sur ( k ) == Day_PD ( j ) . and . Month_Sur ( k ) == Month_PD ( j ) . and . Y e a r _ S u r ( k )
== Year_PD ( j ) . and . H o u r s _ S u r ( k ) == Hours_PD ( j ) . and . M i n u t e s _ S u r ( k ) == Minutes_PD ( j ) )
Then
1370 I f (MD( k ) == TranspLenSum ( j ) ) Then
1371 W r i t e ( * , ’ (A, i , A, i ) ’ ) " S o l u t i o n f o u n d a t : " , k , " & " , j
1372 Index_Sol_Sur = k
1373 Index_Sol_PD = j
1374 W r i t e ( * , ’ (A, I , F8 . 2 ) ’ ) " I n d e x _ S o l _ S u r = " , I n d e x _ S o l _ S u r , MD( k )
1375 W r i t e ( * , ’ (A, I , F8 . 2 ) ’ ) " I n d e x _ S o l _ P D = " , Index_Sol_PD , TranspLenSum ( j )
1376 Return
1377 E l s e I f (MD( k ) <= ( TranspLenSum ( j ) * ( 1 + D e v i a t i o n / 1 0 0 ) ) . and . MD( k ) >= (
TranspLenSum ( j ) * (1 − D e v i a t i o n / 1 0 0 ) ) ) Then
1378 W r i t e ( * , ’ (A, I7 , A, I 7 ) ’ ) " A p p r o x i m a t e s o l u t i o n f o u n d a t : " , i , " & " , j
1379 Index_Sol_Sur = k
1380 Index_Sol_PD = j
1381 SourceLoc_Sur = MD( k )
1382 SourceLoc_PD = TranspLenSum ( j )
1383 W r i t e ( * , ’ (A, I7 , A, A, A, F7 . 2 ) ’ ) " I n d e x _ S o l _ S u r , DateTime , MD
= " , Index_Sol_Sur , " , " , DateTime_Sur ( k ) , " , " , SourceLoc_Sur
1384 W r i t e ( * , ’ (A, I7 , A, A, A, F7 . 2 ) ’ ) " Index_Sol_PD , DateTime , TranspLenSum
= " , Index_Sol_PD , " , " , DateTime_PD ( j ) , " , " , SourceLoc_PD
1385 W r i t e ( * , ’ (A, F5 . 1 ,A) ’ ) " Minimum D e v i a t i o n
= " , D e v i a t i o n , "%"
1386
1387 I f ( S o u r c e L o c _ S u r > SourceLoc_PD ) Then
1388 SourceLocAv = (MD( k ) + MD( k − 1) ) / 2
1389 W r i t e ( * , ’ (A, F ) ’ ) " SourceLoc = " , SourceLocAv
1390 E l s e I f ( S o u r c e L o c _ S u r < SourceLoc_PD ) Then
1391 SourceLocAv = (MD( k ) + MD( k + 1 ) ) / 2
1392 W r i t e ( * , ’ (A, F ) ’ ) " SourceLoc = " , SourceLocAv
1393 End I f
1394
1395 I f ( D e v i a t i o n <= 1 ) Then
177
1460
1461 W r i t e ( * , ’ (A, F8 . 3 , A, F8 . 3 ) ’ ) " E l e v a t i o n C a l c ( I n d e x ) & E l e v a t i o n C a l c ( I n d e x − 1) :
" , E l e v a t i o n C a l c ( I n d e x ) , " , " , E l e v a t i o n C a l c ( I n d e x − 1)
1462 SourceDepth = c1 * E l e v a t i o n C a l c ( I n d e x − 1) + c2 * E l e v a t i o n C a l c ( I n d e x )
1463 W r i t e ( * , ’ (A, F8 . 3 , A, F8 . 3 ) ’ ) "Away ( I n d e x ) & Away ( I n d e x − 1) :
" , Away ( I n d e x ) , " , " , Away ( I n d e x − 1)
1464 SourceAway = c1 * Away ( I n d e x − 1) + c2 * Away ( I n d e x )
1465 W r i t e ( * , ’ (A, F8 . 3 , A, F8 . 3 ) ’ ) " R_Calc ( I n d e x ) & R_Calc ( I n d e x − 1) :
" , R_Calc ( I n d e x ) , " , " , R_Calc ( I n d e x − 1)
1466 SourceRight = c1 * R_Calc ( I n d e x − 1) + c2 * R_Calc ( I n d e x )
1467
1468 W r i t e ( * , ’ (A, F8 . 3 , A, F8 . 3 , A, F8 . 3 ) ’ ) " S o u r c e D e p t h , SourceAway , S o u r c e R i g h t :
" , S o u r c e D e p t h , " , " , SourceAway , " , " , S o u r c e R i g h t
1469 Write ( * , * )
1470
1471 E l s e I f ( SourceLocAv > MD( I n d e x ) ) Then
1472 Write ( * , * )
1473 W r i t e ( * , ’ (A) ’ ) " SourceLocAv > MD"
1474
1475 c1 = a b s ( SourceLocAv − MD( I n d e x ) ) / a b s (MD( I n d e x ) − MD( I n d e x + 1 ) )
1476 c2 = a b s ( SourceLocAv − MD( I n d e x + 1 ) ) / a b s (MD( I n d e x ) − MD( I n d e x + 1 ) )
1477
1478 W r i t e ( * , ’ (A, F8 . 3 , F8 . 3 ) ’ ) " c1 and c2 : " , c1 , c2
1479
1480 W r i t e ( * , ’ (A, F8 . 3 , A, F8 . 3 ) ’ ) " E l e v a t i o n C a l c ( I n d e x ) & E l e v a t i o n C a l c ( I n d e x − 1) :
" , E l e v a t i o n C a l c ( I n d e x ) , " , " , E l e v a t i o n C a l c ( I n d e x − 1)
1481 SourceDepth = c1 * E l e v a t i o n C a l c ( I n d e x − 1) + c2 * E l e v a t i o n C a l c ( I n d e x )
1482 W r i t e ( * , ’ (A, F8 . 3 , A, F8 . 3 ) ’ ) "Away ( I n d e x ) & Away ( I n d e x − 1) :
" , Away ( I n d e x ) , " , " , Away ( I n d e x − 1)
1483 SourceAway = c1 * Away ( I n d e x − 1) + c2 * Away ( I n d e x )
1484 W r i t e ( * , ’ (A, F8 . 3 , A, F8 . 3 ) ’ ) " R_Calc ( I n d e x ) & R_Calc ( I n d e x − 1) :
" , R_Calc ( I n d e x ) , " , " , R_Calc ( I n d e x − 1)
1485 SourceRight = c1 * R_Calc ( I n d e x − 1) + c2 * R_Calc ( I n d e x )
1486
1487 W r i t e ( * , ’ (A, F8 . 3 , A, F8 . 3 , A, F8 . 3 ) ’ ) " S o u r c e D e p t h , SourceAway , S o u r c e R i g h t :
" , S o u r c e D e p t h , " , " , SourceAway , " , " , S o u r c e R i g h t
1488 Write ( * , * )
1489
1490 E l s e I f ( SourceLocAv == MD( I n d e x ) ) Then
1491 Write ( * , * )
1492 W r i t e ( * , ’ (A) ’ ) " SourceLocAv == MD"
1493
1494 SourceDepth = ElevationCalc ( Index )
1495 SourceAway = Away ( I n d e x )
1496 SourceRight = R_Calc ( I n d e x )
1497
1498 W r i t e ( * , ’ (A, F8 . 3 , F8 . 3 , F8 . 3 ) ’ ) " S o u r c e D e p t h , SourceAway , S o u r c e R i g h t : " , S o u r c e D e p t h ,
SourceAway , S o u r c e R i g h t
1499 Write ( * , * )
1500
1501 End I f
1502
1503 End S u b r o u t i n e
1504
1505 ! −−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−
1506
1507 S u b r o u t i n e T r a n s p o r t T i m e s ( DateTime_PD , DateTime_Sur , Index_Sol_PD , I n d e x _ S o l _ S u r , DateTimeSample ,
T i m e I n t 1 , T i m e I n t 2 , TimeIntAv )
1508 ! C a l c u l a t e s t r a n s p o r t t i m e b u t a l s o pumptimes d u r i n g t h e t r a n s p o r t i n t e r v a l , which c a n be
used as the d r i l l time during the t r a n s p o r t i n t e r v a l .
1509 ! Made s e p a r a t e t o c l e a n t h e i n t e r s e c t i o n s u b r o u t i n e .
1510 I m p l i c i t None
1511
1512 Character (19) :: DateTimeSample
1513 Integer :: TimeInt1 , TimeInt2
1514 Integer :: TimeIntAv
1515 Character (19) :: DateTime_PD ( : )
1516 Character (19) :: DateTime_Sur ( : )
1517 Integer :: Index_Sol_PD , I n d e x _ S o l _ S u r
1518 Integer :: HH1 ,MM1, SS1 , HH2 ,MM2, SS2 , HH3 ,MM3, SS3
1519
179
1520 C a l l T i m e I n t e r v a l T w o V a l u e s ( T i m e I n t 1 , D a t e T i m e _ S u r ( I n d e x _ S o l _ S u r ) , DateTimeSample )
1521 C a l l T i m e I n t e r v a l T w o V a l u e s ( T i m e I n t 2 , DateTime_PD ( I n d e x _ S o l _ P D ) , DateTimeSample )
1522
1523 I f ( T i m e I n t 1 >= ( 1 2 * 60 * 6 0 ) ) Then ! S t a b i l i t y measure , a c c o u n t i n g f o r t h e s t o p d u r i n g t h e
night .
1524 T i m e I n t 1 = T i m e I n t 1 − ( 1 2 * 60 * 6 0 )
1525 End I f
1526
1527 I f ( T i m e I n t 2 >= ( 1 2 * 60 * 6 0 ) ) Then
1528 T i m e I n t 2 = T i m e I n t 2 − ( 1 2 * 60 * 6 0 )
1529 End I f
1530
1531 C a l l SecToTimeI ( T i m e I n t 1 , HH1 ,MM1, SS1 )
1532 C a l l SecToTimeI ( T i m e I n t 2 , HH2 ,MM2, SS2 )
1533
1534 W r i t e ( * , ’ (A, I6 , A, I 2 . 2 , A, I 2 . 2 , A, I 2 . 2 ,A) ’ ) " T r a n s p o r t time i s between " , TimeInt1 , " or " ,
HH1 , " : " ,MM1, " : " , SS1 , " and "
1535 W r i t e ( * , ’ (A, I6 , A, I 2 . 2 , A, I 2 . 2 , A, I 2 . 2 ) ’ ) " " , TimeInt2 , " or " ,
HH2 , " : " ,MM2, " : " , SS2
1536
1537 TimeIntAv = ( ( T i m e I n t 1 + T i m e I n t 2 ) * 0 . 5 )
1538 C a l l SecToTimeI ( TimeIntAv , HH3 ,MM3, SS3 )
1539
1540 W r i t e ( * , ’ (A, I6 , A, I 2 . 2 , A, I 2 . 2 , A, I 2 . 2 ) ’ ) " Average t r a n s p o r t time i s " , TimeIntAv , " o r " ,
HH3 , " : " ,MM3, " : " , SS3
1541
1542 End S u b r o u t i n e T r a n s p o r t T i m e s
1543
1544 ! −−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−
1545
1546 S u b r o u t i n e PumpTimes ( MudFlw , TimeInt_PD , Index_Sol_PD , Index_PD , PumpTime )
1547 ! C a l c u l a t e s pump t i m e d u r i n g t h e t r a n s p o r t i n t e r v a l , which c a n be u s e d a s t h e d r i l l t i m e
during the t r a n s p o r t i n t e r v a l .
1548 ! Made s e p a r a t e t o c l e a n t h e i n t e r s e c t i o n s u b r o u t i n e .
1549 I m p l i c i t None
1550
1551 Integer :: i , Index_Sol_PD , Index_PD
1552 Integer :: TimeInt_PD ( : ) ! [s]
1553 Integer :: MudFlw ( : ) ! [ L / min ]
1554 Integer :: PumpTime
1555 Integer :: HH1 ,MM1, SS1 , HH2 ,MM2, SS2
1556
1557 PumpTime = 0
1558
1559 Do i = I n d e x _ S o l _ P D +1 , Index_PD
1560 I f ( MudFlw ( i ) > 0 ) Then
1561 PumpTime = PumpTime + TimeInt_PD ( i )
1562 End I f
1563 End Do
1564
1565 C a l l SecToTimeI ( PumpTime , HH1 ,MM1, SS1 )
1566
1567 W r i t e ( * , ’ (A, I6 , A, I 2 . 2 , A, I 2 . 2 , A, I 2 . 2 ) ’ ) " Pump t i m e i s " , PumpTime , " o r " ,
HH1 , " : " ,MM1, " : " , SS1
1568
1569 End S u b r o u t i n e PumpTimes
1570
1571 ! −−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−
1572 ! Fluid Properties
1573 ! −−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−
1574
1575 S u b r o u t i n e D m a x T r a n s p o r t ( Y_g , T a u _ Y i e l d , Rho_Inflow , Rho_Grain , g , D90 , F l u i d T y p e )
1576 ! C a l c u l a t e s t h e T r a n s p o r t p a r a m e t e r a s f o u n d i n Denekamp , 2 0 0 0 . 0.1 < i s a p r o b l e m and i d e a l
i s >2 o r 4 .
1577 I m p l i c i t None
1578 Real : : Y_g
1579 Real :: Tau_Yield
1580 Real :: Rho_Inflow , Rho_Grain
1581 Real : : D90
1582 Real :: g
1583 Character (2) :: FluidType
180 E. Code of the SampleSource Program
1652
1653 I f ( L o c a t i o n == ’ Den H e l d e r ’ ) Then
1654 I f ( Day_MP <= 11 . and . Month_MP == 9 ) Then
1655 ActivityKey = ’ 85 J ’
1656 E l s e I f ( Day_MP >= 12 . and . Day_MP <= 21 . and . Month_MP == 9 ) Then
1657 ActivityKey = ’ 85M’
1658 E l s e I f ( Day_MP >= 22 . and . Month_MP == 9 ) Then
1659 ActivityKey = ’ 65 J ’
1660 End I f
1661 E l s e I f ( L o c a t i o n == ’ T e x e l ’ ) Then
1662 I f ( Day_MP <= 27 . and . Month_MP == 7 ) Then
1663 ActivityKey = ’ 65m’
1664 E l s e I f ( Day_MP >= 28 . and . Month_MP == 7 ) Then
1665 ActivityKey = ’ 85m’
1666 E l s e I f ( Month_MP == 8 ) Then
1667 ActivityKey = ’ 85m’
1668 End I f
1669 End I f
1670
1671 Do i = 1 , s i z e ( A c t i v i t y )
1672 I f ( A c t i v i t y ( i ) == A c t i v i t y K e y . and . J o i n t N o == J o i n t _ M P ( i ) ) Then
1673 Mud_P = AP ( i )
1674 ! W r i t e ( * , * ) A c t i v i t y K e y , i , A c t i v i t y ( i ) , J o i n t N o , J o i n t _ M P ( i ) , Mud_P
1675 End I f
1676 End Do
1677
1678 End S u b r o u t i n e
1679
1680 ! −−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−
1681
1682 S u b r o u t i n e MaxPlugRadius ( Tau_Y , L , DP , MaxPlugR )
1683 ! C a l c u l a t e s t h e maximum p l u g f l o w r a d i u s i n p i p e s K e l e s s i d i s , 2 0 0 6
1684 I m p l i c i t None
1685
1686 Real :: MaxPlugR
1687 Real :: Tau_Y , DP ! DP i s i n [ kPa ]
1688 Real ( 8 ) :: L
1689
1690 MaxPlugR = 2 . d0 * Tau_Y * ( L / ( DP * 1 0 0 0 . d0 ) ) ! F a c t o r 1000 c h a n g e s t h e u n i t from [
kPa ] t o [ Pa ] which i s t h e same a s t h e Tau_Y .
1691
1692 W r i t e ( * , ’ (A, F5 . 3 ,A) ’ ) "Max P l u g Flow R a d i u s : " , MaxPlugR , " m. "
1693
1694 End S u b r o u t i n e
1695
1696 ! −−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−
1697
1698 S u b r o u t i n e MaxPlugRadius2 ( Tau_Y , L , DP2 , MaxPlugR , D_bh , D_ds )
1699 ! C a l c u l a t e s t h e maximum p l u g f l o w r a d i u s i n p i p e s K e l e s s i d i s , 2 0 0 6
1700 I m p l i c i t None
1701
1702 Real :: MaxPlugR
1703 Real :: Tau_Y , DP2 ! DP i s i n [ kPa ]
1704 Real ( 8 ) :: L
1705 Real :: ya , yb
1706 Real :: h
1707 Real :: D_bh , D_ds
1708
1709 h = ( D_bh − D_ds ) / 2 . d0
1710
1711 ya = ( h / 2 . d0 ) − ( Tau_Y / ( ( DP2 * 1 0 0 0 . d0 ) / L ) )
1712 yb = ( h / 2 . d0 ) + ( Tau_Y / ( ( DP2 * 1 0 0 0 . d0 ) / L ) )
1713
1714 MaxPlugR = yb − ya
1715
1716 W r i t e ( * , ’ (A, F5 . 3 ,A) ’ ) "Max P l u g Flow R a d i u s 2 : " , MaxPlugR , " m. "
1717
1718 End S u b r o u t i n e
1719
1720 ! −−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−
1721
182 E. Code of the SampleSource Program
1842 End Do
1843 C l o s e ( 1 0 , STATUS= ’KEEP ’ )
1844
1845 I f ( P r e s e n t ( S c e n a r i o ) ) Then
1846 W r i t e ( F i l e n a m e , ’ (A, A, I 2 . 2 ,A) ’ ) t r i m ( ID ) , ’ Away S c e n a r i o ’ , S c e n a r i o , ’ . t x t ’
1847 Open ( 1 1 , A c c e s s = ’ S e q u e n t i a l ’ , F i l e = f i l e f o l d e r S c e n a r i o s _ o u t / / t r i m ( F i l e n a m e ) )
1848 W r i t e ( 1 1 , ’ ( A19 , F9 . 3 ) ’ ) x d a t a 2 ( 1 ) , y d a t a 2 ( 1 )
1849 Do i =2 , n2
1850 I f ( y d a t a 2 ( i ) < y d a t a 2 ( i − 1) ) Then
1851 Write (11 , * )
1852 End I f
1853 W r i t e ( 1 1 , ’ ( A19 , 1 x , F9 . 3 ) ’ ) x d a t a 2 ( i ) , y d a t a 2 ( i )
1854 End Do
1855 C l o s e ( 1 1 , S t a t u s = ’ Keep ’ )
1856 End I f
1857
1858 ! C r e a t e g n u p l o t command f i l e
1859 ! −−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−
1860 Open ( 1 0 , ACCESS= ’SEQUENTIAL ’ , FILE= ’ gp . t x t ’ )
1861 W r i t e ( 1 0 , * ) ’ s e t t e r m i n a l png s i z e 2 4 0 0 , 8 0 0 ’ ! Sets i t to create .
png
1862 W r i t e ( F i l e n a m e , ’ (A, I 2 . 2 ,A) ’ ) t r i m ( ID ) / / ’ I n t e r s e c t i o n S c e n a r i o ’ , S c e n a r i o , ’ . png ’
1863 W r i t e ( 1 0 , ’ (A) ’ ) ’ s e t o u t p u t ’ / / ’ " ’ / / ’D : / h i j n e k a m / D e s k t o p / Program / G r a p h s / S a m p l e s / ’ / / t r i m (
filename ) / / ’" ’ ! C r e a t e s . png f i l e and s t o r e s i t i n a d i f f e r e n t f o l d e r . The
" / " u s e d i s d i f f e r e n t from t h e d e f a u l t o r f o r t r a n ( " \ " ) ! ! !
1864
1865 Write (10 , * ) ’ s e t xdata time ’
1866 W r i t e ( 1 0 , * ) ’ s e t t i m e f m t ’ ’%d−%m−%Y %H:%M:%S ’ ’ ’
1867
1868 Write (10 , * ) ’ s e t m u l t i p l o t ’
1869
1870 W r i t e ( 1 0 , * ) ’ s e t t i t l e ’ / / ’ " { / : Bold ’ / / t r i m ( f i l e n a m e ) / / ’ } " ’ ! Graph T i t l e , t i t l e i n b o l d
, works
1871 W r i t e ( 1 0 , * ) ’ s e t x l a b e l ’ / / ’ " ’ / / TRIM ( x l a b e l ) / / ’ " o f f s e t 0 , − 1 ’ ! Offset changes the
p o s i t i o n o f t h e t i t l e , i n t h i s c a s e l o w e r s i t , w / o i t t h e t i t l e and t i c l a b e l s o v e r l a p .
F i r s t number o f f s e t s t h e h o r i z o n t a l p o s i t i o n .
1872 W r i t e ( 1 0 , * ) ’ s e t y l a b e l ’ / / ’ " ’ / / TRIM ( y l a b e l ) / / ’ " ’
1873 W r i t e ( 1 0 , * ) ’ s e t y t i c s 500 ’
1874 Write (10 , * ) ’ s e t mytics 5 ’
1875
1876 W r i t e ( 1 0 , * ) ’ s e t key o p a q u e r i g h t b o t t o m box ’
1877
1878 W r i t e ( 1 0 , ’ (A, A, A, A, A) ’ ) ’ s e t x r a n g e [ " ’ , DateTimeMin , ’ " : " ’ , DateTimeMax , ’ " ] ’
1879 Write (10 , * ) ’ s e t yrange [ 0 : * ] ’
1880
1881 Write (10 , * ) ’ s e t g r i d mytics y t i c s x t i c s ’
1882
1883 C a l l GraphStyle ( Style1 , Layout1 )
1884
1885 C a l l GraphStyle ( Style2 , Layout2 )
1886
1887 I f ( p l o t _ t y p e ==2) W r i t e ( 1 0 , * ) ’ s e t l o g y ’ ! L o g a r i t h m i c s c a l e on t h e y − a x i s o n l y
1888 I f ( p l o t _ t y p e ==3) Then ! L o g a r i t h m i c s c a l e on b o t h a x i s .
1889 Write (10 , * ) ’ s e t log x ’
1890 Write (10 , * ) ’ s e t log y ’
1891 End I f
1892
1893 I f ( n1 > 0 .AND. n2 > 0 ) Then
1894 W r i t e ( 1 0 , ’ (A) ’ ) ’ p l o t " x y d a t a 1 . d a t " u s i n g 1 : 3 w i t h ’ / / L a y o u t 1 / / ’ t i t l e " ’ / / TRIM ( t i t l e 1 ) / /
’ " , " x y d a t a 2 . d a t " u s i n g 1 : 3 w i t h ’ / / L a y o u t 2 / / ’ t i t l e " ’ / / TRIM ( t i t l e 2 ) / / ’ " ’ !
B e c a u s e G n u p l o t r e a d s t i m e and d a t a a s two s e p a r a t e c o l u m n s t h e y − d a t a becomes column 3 .
1895 End I f
1896
1897 I f ( n1 > 0 .AND. n2 ==0) W r i t e ( 1 0 , * ) ’ p l o t " x y d a t a 1 . d a t " u s i n g 1 : 3 w i t h ’ / / L a y o u t 1 / / ’ t i t l e " ’ / /
TRIM ( t i t l e 1 ) / / ’ " ’ ! I f one o f t h e a r r a y s i s empty o n l y one g r a p h w i l l be p l o t e d .
1898
1899 I f ( n2 > 0 .AND. n1 ==0) W r i t e ( 1 0 , * ) ’ p l o t " x y d a t a 2 . d a t " u s i n g 1 : 3 w i t h ’ / / L a y o u t 2 / / ’ t i t l e " ’ / /
TRIM ( t i t l e 2 ) / / ’ " ’
1900
1901 ! Smaller plot
1902 Write (10 , * ) ’ s e t s i z e 0 . 3 , 0 . 3 ’
185
2078 ! W r i t e d a t a on two s e p a r a t e f i l e s
2079 ! −−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−
2080 Open ( 1 0 , A c c e s s = ’SEQUENTIAL ’ , F i l e = ’ x y d a t a 1 . d a t ’ ) ! ProData data
2081 Do i =1 , n1
2082 W r i t e ( 1 0 , ’ ( A19 , 1 x , F9 . 3 ) ’ ) x d a t a 1 ( i ) , y d a t a 1 ( i )
2083 End Do
2084 C l o s e ( 1 0 , S t a t u s = ’KEEP ’ )
2085
2086 Open ( 1 0 , A c c e s s = ’SEQUENTIAL ’ , F i l e = ’ x y d a t a 2 . d a t ’ ) ! Survey Data
2087 W r i t e ( 1 0 , ’ ( A19 , 1 x , F9 . 3 ) ’ ) x d a t a 2 ( 1 ) , y d a t a 2 ( 1 ) ! Required for i f loop
2088 Do i =2 , n2
2089 I f ( y d a t a 2 ( i ) < y d a t a 2 ( i − 1) ) Then
2090 Write (10 , * ) ! Gaps a r e p u t i n t h e d a t a f i l e
i f t h e t i m e b e t w e e n two p o i n t s i s more t h a n 24 h r s , t h i s means t h a t t h e l i n e s w i l l
continue for the n i g h t s h i f t stops .
2091 End I f
2092
2093 W r i t e ( 1 0 , ’ ( A19 , 1 x , F9 . 3 ) ’ ) x d a t a 2 ( i ) , y d a t a 2 ( i )
2094 End Do
2095 C l o s e ( 1 0 , STATUS= ’KEEP ’ )
2096
2097 ! C r e a t e g n u p l o t command f i l e
2098 ! −−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−
2099 Open ( 1 0 , ACCESS= ’SEQUENTIAL ’ , FILE= ’ gp . t x t ’ )
2100 W r i t e ( 1 0 , ’ (A) ’ ) ’ s e t t e r m i n a l png s i z e 2 4 0 0 , 8 0 0 ’ ! Sets i t to create
. png
2101 W r i t e ( 1 0 , ’ (A) ’ ) ’ s e t o u t p u t ’ / / ’ " ’ / / ’D : / h i j n e k a m / D e s k t o p / Program / G r a p h s / ’ / / t r i m ( f i l e n a m e ) / / ’ .
png ’ / / ’ " ’ ! C r e a t e s . png f i l e and s t o r e s i t i n a d i f f e r e n t f o l d e r . The " / "
u s e d i s d i f f e r e n t from t h e d e f a u l t o r f o r t r a n ( " \ " ) ! ! !
2102 W r i t e ( 1 0 , ’ (A) ’ ) ’ s e t t i t l e ’ / / ’ " { / : Bold ’ / / t r i m ( t i t l e ) / / ’ } " ’ ! Graph T i t l e , t i t l e i n
b o l d , works
2103 W r i t e ( 1 0 , ’ (A) ’ ) ’ s e t x l a b e l ’ / / ’ " ’ / / TRIM ( x l a b e l ) / / ’ " o f f s e t 0 , − 1 ’ ! Offset changes
t h e p o s i t i o n o f t h e t i t l e , i n t h i s c a s e l o w e r s i t , w / o i t t h e t i t l e and t i c l a b e l s
o v e r l a p . F i r s t number o f f s e t s t h e h o r i z o n t a l p o s i t i o n .
2104 W r i t e ( 1 0 , ’ (A) ’ ) ’ s e t y l a b e l ’ / / ’ " ’ / / TRIM ( y l a b e l ) / / ’ " ’
2105
2106 W r i t e ( 1 0 , ’ (A) ’ ) ’ s e t x d a t a t i m e ’
2107 W r i t e ( 1 0 , ’ (A) ’ ) ’ s e t t i m e f m t ’ ’%d−%m−%Y %H:%M:%S ’ ’ ’
2108
2109 W r i t e ( 1 0 , ’ (A) ’ ) ’ s e t y r a n g e [ 0 : * ] ’ ! Forces the
minimum o f t h e y − a x i s t o be 0 w h i l e t h e u p p e r l i m i t i s still flexible .
2110
2111 W r i t e ( 1 0 , ’ (A) ’ ) ’ s e t key o p a q u e r i g h t t o p box ’
2112
2113 C a l l GraphStyle ( Style1 , Layout1 )
2114
2115 C a l l GraphStyle ( Style2 , Layout2 )
2116
2117 I f ( p l o t _ t y p e ==2) W r i t e ( 1 0 , * ) ’ s e t l o g y ’ ! L o g a r i t h m i c s c a l e on t h e y − a x i s o n l y
2118 I f ( p l o t _ t y p e ==3) Then ! L o g a r i t h m i c s c a l e on b o t h a x i s .
2119 W r i t e ( 1 0 , ’ (A) ’ ) ’ s e t l o g x ’
2120 W r i t e ( 1 0 , ’ (A) ’ ) ’ s e t l o g y ’
2121 End I f
2122
2123 I f ( n1 > 0 .AND. n2 > 0 ) Then
2124 W r i t e ( 1 0 , ’ (A) ’ ) ’ p l o t " x y d a t a 1 . d a t " u s i n g 1 : 3 w i t h ’ / / L a y o u t 1 / / ’ t i t l e " ’ / / TRIM ( t i t l e 1 ) / /
’ " , " x y d a t a 2 . d a t " u s i n g 1 : 3 w i t h ’ / / L a y o u t 2 / / ’ t i t l e " ’ / / TRIM ( t i t l e 2 ) / / ’ " ’ !
B e c a u s e G n u p l o t r e a d s t i m e and d a t a a s two s e p a r a t e c o l u m n s t h e y − d a t a becomes column 3 .
2125 End I f
2126
2127 I f ( n1 > 0 .AND. n2 ==0) W r i t e ( 1 0 , * ) ’ p l o t " x y d a t a 1 . d a t " u s i n g 1 : 3 w i t h ’ / / L a y o u t 1 / / ’ t i t l e " ’ / /
TRIM ( t i t l e 1 ) / / ’ " ’ ! I f one o f t h e a r r a y s i s empty o n l y one g r a p h w i l l be p l o t e d .
2128
2129 I f ( n2 > 0 .AND. n1 ==0) W r i t e ( 1 0 , * ) ’ p l o t " x y d a t a 2 . d a t " u s i n g 1 : 3 w i t h ’ / / L a y o u t 2 / / ’ t i t l e " ’ / /
TRIM ( t i t l e 2 ) / / ’ " ’
2130
2131 C l o s e ( 1 0 , STATUS= ’KEEP ’ )
2132
2133 ! P l o t c u r v e w i t h g n u p l o t and c l e a n u p f i l e s
2134 ! −−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−
2135 C a l l SYSTEM( ’ g n u p l o t gp . t x t ’ )
189
2136
2137 ! Pause ! To c h e c k t h e gnu f i l e b e f o r e d e l e t i o n i f t h e g r a p h i s n o t a s e x p e c t e d
.
2138
2139 C a l l SYSTEM( ’ d e l gp . t x t ’ )
2140 C a l l SYSTEM( ’ d e l x y d a t a 1 . d a t ’ )
2141 C a l l SYSTEM( ’ d e l x y d a t a 2 . d a t ’ )
2142
2143 ! Check m e s s a g e
2144 ! −−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−
2145 W r i t e ( * , ’ (A) ’ ) ’ F i l e ’ / / ’ " ’ / / t r i m ( f i l e n a m e ) / / ’ . png ’ / / ’ " ’ / / ’ i s c r e a t e d . ’
2146
2147 End S u b r o u t i n e
2148
2149 ! −−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−
2150
2151 S u b r o u t i n e f2gpLagD ( l o c a t i o n , t i t l e _ g r a p h , x d a t a 1 , y d a t a 1 , p l o t _ t y p e , x l a b e l , y l a b e l , f i l e n a m e ,
title1 , style1 , style2 , style3 , style4 )
2152 ! W r i t e s f i l e ( s ) w i t h d a t a f o r g r a p h ( s ) , w r i t e s a f i l e t o be r e a d by g n u p l o t and c a l l s
g n u p l o t t o r e a d i t and c o n s t r u c t a g r a p h a c c o r d i n g t o t h e i n s t r u c t i o n s i n t h e f i l e and
the data in the f i r s t f i l e ( s ) .
2153 ! S o u r c e : h t t p : / / i m p l i c i t n o n e . com / f o r t r a n − g n u p l o t / , s i m p l e and more t o t h e p o i n t t h a n t h e
PlotModule . f90
2154 ! SPECIAL CASE ; t h e r e i s o n l y one d a t a s e t which i s d i v i d e d i n t o t h r e e p a r t s , s t y l e a s s u c h
i s put in manually i n s t e a d of with the s u b r o u t i n e .
2155 ! P l o t s the lag diagram .
2156 I m p l i c i t None
2157
2158 Integer : : n1 ! number o f d a t a p o i n t s
2159 Real ( 8 ) :: xdata1 ( : ) ! f i r s t x data array
2160 Real ( 8 ) :: ydata1 ( : ) ! f i r s t y data array
2161 Integer :: plot_type ! 1 for l i n e a r plot , 2 for log
plot , 3 for log −l o g p l o t
2162 Character (*) :: xlabel , ylabel , filename , t i t l e 1 , t i t l e _ g r a p h
2163 ! Integer :: TimeInt
2164
2165 Character (2) :: style1 , style2 , style3 , style4
2166 Character (25) :: Layout1 , Layout2 , Layout3 , L a y o u t 4
2167
2168 Integer :: i, j, k
2169
2170 Character (*) :: Location
2171
2172 n1 = s i z e ( x d a t a 1 )
2173
2174 ! −−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−
2175 ! Write data in f i l e s
2176 ! −−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−
2177
2178 Open ( 1 0 , F i l e = ’ x y d a t a 0 . d a t ’ )
2179 Open ( 1 1 , F i l e = ’ x y d a t a 1 . d a t ’ )
2180 Open ( 1 2 , F i l e = ’ x y d a t a 2 . d a t ’ )
2181
2182 Do i = 1 , n1 ! ROP = 0 , VT=VL
2183 W r i t e ( 1 0 , ’ ( F9 . 3 , 1 x , F9 . 3 ) ’ ) x d a t a 1 ( i ) , x d a t a 1 ( i )
2184 End do
2185
2186 I f ( L o c a t i o n == ’ T e x e l ’ ) Then
2187
2188 Do i =1 ,24
2189 W r i t e ( 1 1 , ’ ( F9 . 3 , 1 x , F9 . 3 ) ’ ) x d a t a 1 ( i ) , y d a t a 1 ( i )
2190 End Do
2191
2192 Do i =25 , n1
2193 W r i t e ( 1 2 , ’ ( F9 . 3 , 1 x , F9 . 3 ) ’ ) x d a t a 1 ( i ) , y d a t a 1 ( i )
2194 End Do
2195
2196 E l s e I f ( L o c a t i o n == ’ Den H e l d e r ’ ) Then
2197
2198 Do i =1 ,20
2199 W r i t e ( 1 1 , ’ ( F9 . 3 , 1 x , F9 . 3 ) ’ ) x d a t a 1 ( i ) , y d a t a 1 ( i )
190 E. Code of the SampleSource Program
2200 End Do
2201
2202 Do i =21 , n1 −1 ! L a s t s a m p l e i n Den H e l d e r i s n o t v a l i d .
2203 W r i t e ( 1 2 , ’ ( F9 . 3 , 1 x , F9 . 3 ) ’ ) x d a t a 1 ( i ) , y d a t a 1 ( i )
2204
2205 End Do
2206 End I f
2207
2208 Close (10)
2209 Close (11)
2210 Close (12)
2211
2212
2213
2214 ! C r e a t e g n u p l o t command f i l e
2215 ! −−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−
2216 Open ( 1 0 , ACCESS= ’SEQUENTIAL ’ , FILE= ’ gp . t x t ’ )
2217
2218 W r i t e ( 1 0 , ’ (A) ’ ) ’ s e t t e r m i n a l png s i z e 1 8 0 0 , 1 8 0 0 ’ ! Sets i t to
c r e a t e . png
2219 W r i t e ( 1 0 , ’ (A) ’ ) ’ s e t o u t p u t ’ / / ’ " ’ / / ’D : / h i j n e k a m / D e s k t o p / Program / G r a p h s / ’ / / t r i m ( f i l e n a m e ) / / ’ .
png ’ / / ’ " ’ ! C r e a t e s . png f i l e and s t o r e s i t i n a d i f f e r e n t f o l d e r . The " / "
u s e d i s d i f f e r e n t from t h e d e f a u l t o r f o r t r a n ( " \ " ) ! ! !
2220 W r i t e ( 1 0 , ’ (A) ’ ) ’ s e t t i t l e ’ / / ’ " { / : Bold ’ / / t r i m ( t i t l e _ g r a p h ) / / ’ } " o f f s e t 0 , − 1 font " ,32" ’
! Graph T i t l e , t i t l e i n b o l d , works
2221 W r i t e ( 1 0 , ’ (A) ’ ) ’ s e t x l a b e l ’ / / ’ " ’ / / TRIM ( x l a b e l ) / / ’ " o f f s e t 0 , − 0 . 5 f o n t " , 2 4 " ’ !
O f f s e t c h a n g e s t h e p o s i t i o n o f t h e t i t l e , i n t h i s c a s e l o w e r s i t , w / o i t t h e t i t l e and
t i c l a b e l s o v e r l a p . F i r s t number o f f s e t s t h e h o r i z o n t a l p o s i t i o n .
2222 W r i t e ( 1 0 , ’ (A) ’ ) ’ s e t y l a b e l ’ / / ’ " ’ / / TRIM ( y l a b e l ) / / ’ " o f f s e t 2 , 0 font " ,24" ’
2223
2224 W r i t e ( 1 0 , ’ (A) ’ ) ’ s e t s i z e 0 . 9 8 ’
2225 W r i t e ( 1 0 , ’ (A) ’ ) ’ s e t o r i g i n 0 . 0 1 , 0 ’
2226
2227 W r i t e ( 1 0 , ’ (A) ’ ) ’ s e t y r a n g e [ 0 : * ] ’ ! Forces the
minimum o f t h e y − a x i s t o be 0 w h i l e t h e u p p e r l i m i t i s still flexible .
2228
2229 W r i t e ( 1 0 , ’ (A) ’ ) ’ s e t g r i d ’
2230 W r i t e ( 1 0 , ’ (A) ’ ) ’ s e t key box o p a q u e r i g h t b o t t o m f o n t " , 2 4 " s p a c i n g 1 . 3 ’ !
Box c a n be a d d e d t o p u t a box a r o u n d t h e key , i t o v e r l a p s w i t h t h e l e t t e r s s o i t was
removed
2231
2232 Call GraphStyle ( Style1 , Layout1 )
2233 Call GraphStyle ( Style2 , Layout2 )
2234 Call GraphStyle ( Style3 , Layout3 )
2235 Call GraphStyle ( Style4 , Layout4 )
2236
2237 ! W r i t e ( 1 0 , ’ (A) ’ ) ’ p l o t " x y d a t a 1 . d a t " u s i n g 1 : 2 w i t h ’ / / L a y o u t 1 / / ’ t i t l e " ’ / / ’ NAP− 85m J e t b i t ,
’ / / TRIM ( t i t l e 1 ) / / ’ " , " x y d a t a 2 . d a t " u s i n g 1 : 2 w i t h ’ / / L a y o u t 2 / / ’ t i t l e " ’ / / ’ NAP− 85m
Mudmotor , ’ / / Trim ( t i t l e 1 ) / / ’ " , " x y d a t a 3 . d a t " u s i n g 1 : 2 w i t h ’ / / L a y o u t 3 / / ’ t i t l e " ’ / / ’ NAP
−65m J e t b i t , ’ / / Trim ( t i t l e 1 ) / / ’ " , " x y d a t a 0 . d a t " u s i n g 1 : 2 w i t h ’ / / L a y o u t 4 / / ’ t i t l e " ’ / / ’
ROP = 0 , ’ / / TRIM ( t i t l e 1 ) / / ’ " ’
2238
2239 I f ( L o c a t i o n == ’ T e x e l ’ ) Then
2240 W r i t e ( 1 0 , ’ (A) ’ ) ’ p l o t " x y d a t a 0 . d a t " u s i n g 1 : 2 w i t h ’ / / L a y o u t 4 / / ’ t i t l e " ’ / / ’ROP = 0 , ’ / /
TRIM ( t i t l e 1 ) / / ’ " , " x y d a t a 1 . d a t " u s i n g 1 : 2 w i t h ’ / / L a y o u t 2 / / ’ t i t l e " ’ / / ’NAP− 65m, ’ / / Trim (
t i t l e 1 ) / / ’ " , " xydata2 . dat " using 1:2 with ’ / / L a y o u t 3 / / ’ t i t l e " ’ / / ’NAP −85m, ’ / / Trim (
title1 ) // ’" ’
2241 E l s e I f ( L o c a t i o n == ’ Den H e l d e r ’ ) Then
2242 W r i t e ( 1 0 , ’ (A) ’ ) ’ p l o t " x y d a t a 0 . d a t " u s i n g 1 : 2 w i t h ’ / / L a y o u t 4 / / ’ t i t l e " ’ / / ’ROP = 0 , ’ / /
TRIM ( t i t l e 1 ) / / ’ " , " x y d a t a 1 . d a t " u s i n g 1 : 2 w i t h ’ / / L a y o u t 2 / / ’ t i t l e " ’ / / ’NAP− 85m, ’ / / Trim (
t i t l e 1 ) / / ’ " , " xydata2 . dat " using 1:2 with ’ / / L a y o u t 3 / / ’ t i t l e " ’ / / ’NAP −65m, ’ / / Trim (
title1 ) // ’" ’
2243 End I f
2244
2245 C l o s e ( 1 0 , STATUS= ’KEEP ’ )
2246
2247 ! P l o t c u r v e w i t h g n u p l o t and c l e a n u p f i l e s
2248 ! −−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−
2249 C a l l SYSTEM( ’ g n u p l o t gp . t x t ’ )
2250
2251 ! Pause ! To c h e c k t h e gnu f i l e b e f o r e d e l e t i o n i f t h e g r a p h i s n o t a s e x p e c t e d
191
.
2252
2253 Call SYSTEM( ’ del gp . t x t ’ )
2254 Call SYSTEM( ’ del xydata0 . dat ’ )
2255 Call SYSTEM( ’ del xydata1 . dat ’ )
2256 Call SYSTEM( ’ del xydata2 . dat ’ )
2257
2258 ! Check m e s s a g e
2259 ! −−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−
2260 W r i t e ( * , ’ (A) ’ ) ’ F i l e ’ / / ’ " ’ / / t r i m ( f i l e n a m e ) / / ’ . png ’ / / ’ " ’ / / ’ i s c r e a t e d . ’
2261
2262 End S u b r o u t i n e
2263
2264 ! −−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−
2265
2266 S u b r o u t i n e f 2 g p 5 ( ID , x d a t a 1 , y d a t a 1 , s t y l e 1 , p l o t _ t y p e , x l a b e l , y l a b e l , t i t l e , t i t l e 1 )
2267 ! W r i t e s f i l e ( s ) w i t h d a t a f o r g r a p h ( s ) , w r i t e s a f i l e t o be r e a d by g n u p l o t and c a l l s
g n u p l o t t o r e a d i t and c o n s t r u c t a g r a p h a c c o r d i n g t o t h e i n s t r u c t i o n s i n t h e f i l e and
the data in the f i r s t f i l e ( s ) .
2268 ! S o u r c e : h t t p : / / i m p l i c i t n o n e . com / f o r t r a n − g n u p l o t / , s i m p l e and more t o t h e p o i n t t h a n t h e
PlotModule . f90
2269 ! Alpha D e l t a , s u b r o u t i n e i s n o t c a l l e d anymore , i t i s i n c l u d e d i n f 2 g p S a m p l e M u l t i .
2270 I m p l i c i t None
2271
2272 Character (*) : : ID ! Sample ID . , u s e d f o r
t i t l e o f g r a p h and g r a p h f i l e n a m e .
2273 Integer : : n1 ! number o f d a t a p o i n t s
2274 Real ( 8 ) :: xdata1 ( : ) ! f i r s t x data array
2275 Real ( 8 ) :: ydata1 ( : ) ! f i r s t y data array
2276 Integer :: plot_type ! 1 for l i n e a r plot , 2 for
l o g p l o t , 3 f o r log −l o g p l o t
2277 Character (2) :: style1
2278 C h a r a c t e r ( l e n =* ) :: xlabel , ylabel , t i t l e , t i t l e 1 ! p l o t a x i s l a b e l s and
title (s)
2279 Character (25) :: Layout1
2280
2281 Integer :: i
2282
2283 n1 = s i z e ( x d a t a 1 )
2284
2285 ! W r i t e ( * , * ) n1
2286
2287 ! −−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−
2288 ! Write data in f i l e s
2289 ! −−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−
2290 Open ( 1 0 , A c c e s s = ’SEQUENTIAL ’ , F i l e = ’ x y d a t a 1 . d a t ’ )
2291
2292 Do i =1 , n1
2293 W r i t e ( 1 0 , ’ ( F9 . 3 , 1 x , F9 . 3 ) ’ ) x d a t a 1 ( i ) , y d a t a 1 ( i )
2294 End do
2295
2296 C l o s e ( 1 0 , S t a t u s = ’KEEP ’ )
2297
2298 ! C r e a t e g n u p l o t command f i l e
2299 ! −−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−
2300 Open ( 1 0 , ACCESS= ’SEQUENTIAL ’ , FILE= ’ gp . t x t ’ )
2301
2302 W r i t e ( 1 0 , * ) ’ s e t t e r m i n a l png s i z e 1 2 0 0 , 1 2 0 0 ’ ! Sets i t to create .
png
2303 W r i t e ( 1 0 , ’ (A) ’ ) ’ s e t o u t p u t ’ / / ’ " ’ / / ’D : / h i j n e k a m / D e s k t o p / Program / G r a p h s / P l o t ’ / / ID / / ’ ’ / /
T i t l e / / ’ . png ’ / / ’ " ’ ! C r e a t e s . png f i l e and s t o r e s i t i n a d i f f e r e n t f o l d e r .
The " / " u s e d i s d i f f e r e n t from t h e d e f a u l t o r f o r t r a n ( " \ " ) ! ! !
2304 W r i t e ( 1 0 , * ) ’ s e t t i t l e ’ / / ’ " { / : Bold ’ / / T i t l e / / ’ ’ / / ID / / ’ } " ’ ! Graph T i t l e , t i t l e i n b o l d
, works
2305 W r i t e ( 1 0 , * ) ’ s e t x l a b e l ’ / / ’ " ’ / / TRIM ( x l a b e l ) / / ’ " o f f s e t 0 , − 1 ’ ! Offset changes the
p o s i t i o n o f t h e t i t l e , i n t h i s c a s e l o w e r s i t , w / o i t t h e t i t l e and t i c l a b e l s o v e r l a p .
F i r s t number o f f s e t s t h e h o r i z o n t a l p o s i t i o n .
2306 W r i t e ( 1 0 , * ) ’ s e t y l a b e l ’ / / ’ " ’ / / TRIM ( y l a b e l ) / / ’ " ’
2307
2308 Write (10 , * ) ’ s e t yrange [ 0 : * ] ’ ! F o r c e s t h e minimum o f
t h e y − a x i s t o be 0 w h i l e t h e u p p e r l i m i t i s still flexible .
192 E. Code of the SampleSource Program
2309
2310 ! W r i t e ( 1 0 , * ) ’ s e t key opaque ’
2311 W r i t e ( 1 0 , * ) ’ s e t key o p a q u e r i g h t b o t t o m box ’
2312
2313 C a l l GraphStyle ( Style1 , Layout1 )
2314
2315 I f ( p l o t _ t y p e ==2) W r i t e ( 1 0 , * ) ’ s e t l o g y ’ ! L o g a r i t h m i c s c a l e on t h e y − a x i s o n l y
2316 I f ( p l o t _ t y p e ==3) Then ! L o g a r i t h m i c s c a l e on b o t h a x i s .
2317 Write (10 , * ) ’ s e t log x ’
2318 Write (10 , * ) ’ s e t log y ’
2319 End I f
2320
2321 W r i t e ( 1 0 , ’ (A, I , A) ’ ) ’ p l o t " x y d a t a 1 . d a t " u s i n g 1 : 2 w i t h ’ / / L a y o u t 1 / / ’ t i t l e " ’ / / TRIM ( t i t l e 1 ) / /
’" ’
2322
2323 C l o s e ( 1 0 , STATUS= ’KEEP ’ )
2324
2325 ! P l o t c u r v e w i t h g n u p l o t and c l e a n u p f i l e s
2326 ! −−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−
2327 C a l l SYSTEM( ’ g n u p l o t gp . t x t ’ )
2328
2329 ! Pause ! To c h e c k t h e gnu f i l e b e f o r e d e l e t i o n i f t h e g r a p h i s n o t a s e x p e c t e d
.
2330
2331 C a l l SYSTEM( ’ d e l gp . t x t ’ )
2332 C a l l SYSTEM( ’ d e l x y d a t a 1 . d a t ’ )
2333
2334 ! Check m e s s a g e
2335 ! −−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−
2336 W r i t e ( * , ’ (A) ’ ) ’ F i l e ’ / / ’ " ’ / / ’ P l o t ’ / / ID / / ’ ’ / / T i t l e / / ’ . png ’ / / ’ " ’ / / ’ i s c r e a t e d . ’
2337
2338 End S u b r o u t i n e
2339
2340 ! −−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−
2341
2342 S u b r o u t i n e f 2 g p 6 ( ID , x d a t a 1 , y d a t a 1 , s t y l e 1 , x d a t a 2 , y d a t a 2 , s t y l e 2 , p l o t _ t y p e , x l a b e l , y l a b e l , t i t l e ,
title1 , title2 )
2343 ! W r i t e s f i l e ( s ) w i t h d a t a f o r g r a p h ( s ) , w r i t e s a f i l e t o be r e a d by g n u p l o t and c a l l s
g n u p l o t t o r e a d i t and c o n s t r u c t a g r a p h a c c o r d i n g t o t h e i n s t r u c t i o n s i n t h e f i l e and
the data in the f i r s t f i l e ( s ) .
2344 ! S o u r c e : h t t p : / / i m p l i c i t n o n e . com / f o r t r a n − g n u p l o t / , s i m p l e and more t o t h e p o i n t t h a n t h e
PlotModule . f90
2345 ! F l u i d m e a s u r e m e n t s and c a l c u l a t i o n r e s u l t s , s u b r o u t i n e i s n o t c a l l e d anymore , i t i s
included in f2gpSampleMulti .
2346 I m p l i c i t None
2347
2348 Character (*) : : ID ! Sample ID . , u s e d f o r
t i t l e o f g r a p h and g r a p h f i l e n a m e .
2349 Integer : : n1 ! number o f d a t a p o i n t s
2350 Real ( 8 ) :: xdata1 ( : ) , xdata2 ( : ) ! f i r s t x data array
2351 Real ( 8 ) :: ydata1 ( : ) , ydata2 ( : ) ! f i r s t y data array
2352 Integer :: plot_type ! 1 for l i n e a r plot , 2 for
l o g p l o t , 3 f o r log −l o g p l o t
2353
2354 C h a r a c t e r ( l e n =* ) :: xlabel , ylabel , t i t l e , t i t l e 1 , t i t l e 2 ! p l o t a x i s l a b e l s and
title (s)
2355 Character (2) :: style1 , style2
2356 Character (25) :: Layout1 , L a y o u t 2
2357
2358 Integer :: i
2359
2360 n1 = s i z e ( x d a t a 1 )
2361
2362 ! W r i t e ( * , * ) n1
2363
2364 ! −−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−
2365 ! Write data in f i l e s
2366 ! −−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−
2367 Open ( 1 0 , A c c e s s = ’SEQUENTIAL ’ , F i l e = ’ x y d a t a 1 . d a t ’ )
2368
2369 Do i =1 , n1
193
2370 W r i t e ( 1 0 , ’ ( F9 . 3 , 1 x , F9 . 3 ) ’ ) x d a t a 1 ( i ) , y d a t a 1 ( i )
2371 End do
2372
2373 C l o s e ( 1 0 , S t a t u s = ’KEEP ’ )
2374
2375 Open ( 1 0 , A c c e s s = ’SEQUENTIAL ’ , F i l e = ’ x y d a t a 2 . d a t ’ )
2376
2377 Do i =1 , n1
2378 W r i t e ( 1 0 , ’ ( F9 . 3 , 1 x , F9 . 3 ) ’ ) x d a t a 2 ( i ) , y d a t a 2 ( i )
2379 End do
2380
2381 C l o s e ( 1 0 , S t a t u s = ’KEEP ’ )
2382
2383 ! C r e a t e g n u p l o t command f i l e
2384 ! −−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−
2385 Open ( 1 0 , ACCESS= ’SEQUENTIAL ’ , FILE= ’ gp . t x t ’ )
2386
2387 W r i t e ( 1 0 , * ) ’ s e t t e r m i n a l png s i z e 1 2 0 0 , 1 2 0 0 ’ ! Sets i t to create .
png
2388 W r i t e ( 1 0 , ’ (A) ’ ) ’ s e t o u t p u t ’ / / ’ " ’ / / ’D : / h i j n e k a m / D e s k t o p / Program / G r a p h s / P l o t ’ / / ID / / ’ ’ / /
T i t l e / / ’ . png ’ / / ’ " ’ ! C r e a t e s . png f i l e and s t o r e s i t i n a d i f f e r e n t f o l d e r .
The " / " u s e d i s d i f f e r e n t from t h e d e f a u l t o r f o r t r a n ( " \ " ) ! ! !
2389 W r i t e ( 1 0 , * ) ’ s e t t i t l e ’ / / ’ " { / : Bold ’ / / T i t l e / / ’ ’ / / ID / / ’ } " ’ ! Graph T i t l e , t i t l e i n b o l d
, works
2390 W r i t e ( 1 0 , * ) ’ s e t x l a b e l ’ / / ’ " ’ / / TRIM ( x l a b e l ) / / ’ " o f f s e t 0 , − 1 ’ ! Offset changes the
p o s i t i o n o f t h e t i t l e , i n t h i s c a s e l o w e r s i t , w / o i t t h e t i t l e and t i c l a b e l s o v e r l a p .
F i r s t number o f f s e t s t h e h o r i z o n t a l p o s i t i o n .
2391 W r i t e ( 1 0 , * ) ’ s e t y l a b e l ’ / / ’ " ’ / / TRIM ( y l a b e l ) / / ’ " ’
2392
2393 Write (10 , * ) ’ s e t yrange [ 0 : * ] ’ ! F o r c e s t h e minimum o f
t h e y − a x i s t o be 0 w h i l e t h e u p p e r l i m i t i s still flexible .
2394
2395 W r i t e ( 1 0 , * ) ’ s e t key o p a q u e r i g h t b o t t o m box ’
2396
2397 C a l l GraphStyle ( Style1 , Layout1 )
2398
2399 C a l l GraphStyle ( Style2 , Layout2 )
2400
2401 I f ( p l o t _ t y p e == 2 ) W r i t e ( 1 0 , * ) ’ s e t l o g y ’ ! L o g a r i t h m i c s c a l e on t h e y − a x i s o n l y
2402 I f ( p l o t _ t y p e == 3 ) Then ! L o g a r i t h m i c s c a l e on b o t h a x i s .
2403 Write (10 , * ) ’ s e t log x ’
2404 Write (10 , * ) ’ s e t log y ’
2405 End I f
2406
2407 W r i t e ( 1 0 , ’ (A, I , A) ’ ) ’ p l o t " x y d a t a 1 . d a t " u s i n g 1 : 2 w i t h ’ / / L a y o u t 1 / / ’ t i t l e " ’ / / TRIM ( t i t l e 1 ) / /
’ " , " x y d a t a 2 . d a t " u s i n g 1 : 2 w i t h ’ / / L a y o u t 2 / / ’ t i t l e " ’ / / TRIM ( t i t l e 2 ) / / ’ " ’
2408
2409 C l o s e ( 1 0 , STATUS= ’KEEP ’ )
2410
2411 ! P l o t c u r v e w i t h g n u p l o t and c l e a n u p f i l e s
2412 ! −−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−
2413 C a l l SYSTEM( ’ g n u p l o t gp . t x t ’ )
2414
2415 ! Pause ! To c h e c k t h e gnu f i l e b e f o r e d e l e t i o n i f t h e g r a p h i s n o t a s e x p e c t e d
.
2416
2417 C a l l SYSTEM( ’ d e l gp . t x t ’ )
2418 C a l l SYSTEM( ’ d e l x y d a t a 1 . d a t ’ )
2419 C a l l SYSTEM( ’ d e l x y d a t a 2 . d a t ’ )
2420
2421 ! Check m e s s a g e
2422 ! −−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−
2423 W r i t e ( * , ’ (A) ’ ) ’ F i l e ’ / / ’ " ’ / / ’ P l o t ’ / / ID / / ’ ’ / / T i t l e / / ’ . png ’ / / ’ " ’ / / ’ i s c r e a t e d . ’
2424
2425 End S u b r o u t i n e
2426
2427 ! −−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−
2428
2429 S u b r o u t i n e f 2 g p S a m p l e M u l t i ( ID , n0 , n5 , n6 , x d a t a 0 , y d a t a 0 , s t y l e 0 , x d a t a 5 , y d a t a 5 , s t y l e 5 , x d a t a 1 ,
ydata1 , s t y l e 1 , xdata2 , ydata2 , s t y l e 2 , ydata3 , s t y l e 3 , ydata4 , s t y l e 4 , xlabel0 , ylabel0 , xlabel1 ,
ylabel1 , xlabel2 , ylabel2 , t i t l e , t i t l e 0 , t i t l e 1 , t i t l e 2 , g_title1 , g_title2 , g_title3 , g_title4 ,
194 E. Code of the SampleSource Program
2487 Open ( 1 1 , A c c e s s = ’ S e q u e n t i a l ’ , F i l e = f i l e f o l d e r S c e n a r i o s _ o u t / / t r i m ( F i l e n a m e ) )
2488 Do i =1 , n0
2489 W r i t e ( 1 1 , ’ ( A19 , 1 x , F9 . 3 ) ’ ) x d a t a 0 ( i ) , y d a t a 0 ( i )
2490 End Do
2491 C l o s e ( 1 1 , S t a t u s = ’ Keep ’ )
2492 End I f
2493
2494 ! −−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−
2495
2496 Open ( 1 0 , A c c e s s = ’SEQUENTIAL ’ , F i l e = ’ x y d a t a 5 . d a t ’ ) ! Survey Data
2497 W r i t e ( 1 0 , ’ ( A19 , 1 x , F9 . 3 ) ’ ) x d a t a 5 ( 1 ) , y d a t a 5 ( 1 ) ! Required for i f loop
2498 Do i =2 , n5
2499 I f ( y d a t a 5 ( i ) < y d a t a 5 ( i − 1) ) Then
2500 Write (10 , * )
2501 End I f
2502 ! C a l l T i m e I n t e r v a l T w o V a l u e s ( T i m e I n t , x d a t a 5 ( i ) , x d a t a 5 ( i − 1) )
2503 ! I f ( T i m e I n t >= ( 2 4 * 60 * 6 0 ) ) Then ! C r e a t e s gaps in the data
which w i l l c a u s e t h e l i n e t o be b r o k e n i n t h e g r a p h .
2504 ! Write (10 , * ) ! Gaps a r e p u t in the data
f i l e i f t h e t i m e b e t w e e n two p o i n t s i s more t h a n 24 h r s , t h i s means t h a t the lines will
continue for the n i g h t s h i f t stops .
2505 ! End I f
2506 W r i t e ( 1 0 , ’ ( A19 , 1 x , F9 . 3 ) ’ ) x d a t a 5 ( i ) , y d a t a 5 ( i )
2507 End Do
2508 C l o s e ( 1 0 , STATUS= ’KEEP ’ )
2509
2510 I f ( P r e s e n t ( S c e n a r i o ) ) Then
2511 W r i t e ( F i l e n a m e , ’ (A, A, I 2 . 2 ,A) ’ ) t r i m ( ID ) , ’ Away S c e n a r i o ’ , S c e n a r i o , ’ . t x t ’
2512 Open ( 1 1 , A c c e s s = ’ S e q u e n t i a l ’ , F i l e = f i l e f o l d e r S c e n a r i o s _ o u t / / t r i m ( F i l e n a m e ) )
2513 W r i t e ( 1 1 , ’ ( A19 , F9 . 3 ) ’ ) x d a t a 5 ( 1 ) , y d a t a 5 ( 1 )
2514 Do i =2 , n5
2515 I f ( y d a t a 5 ( i ) < y d a t a 5 ( i − 1) ) Then
2516 Write (11 , * )
2517 End I f
2518 W r i t e ( 1 1 , ’ ( A19 , 1 x , F9 . 3 ) ’ ) x d a t a 5 ( i ) , y d a t a 5 ( i )
2519 End Do
2520 C l o s e ( 1 1 , S t a t u s = ’ Keep ’ )
2521 End I f
2522
2523 ! −−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−
2524
2525 Open ( 1 0 , A c c e s s = ’SEQUENTIAL ’ , F i l e = ’ x y d a t a 1 . d a t ’ )
2526 ! Alpha / D e l t a
2527 Do i =1 , n1
2528 W r i t e ( 1 0 , ’ ( F9 . 3 , 1 x , F9 . 3 ) ’ ) x d a t a 1 ( i ) , y d a t a 1 ( i )
2529 End do
2530
2531 C l o s e ( 1 0 , S t a t u s = ’KEEP ’ )
2532
2533 ! −−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−
2534
2535 Open ( 1 0 , A c c e s s = ’SEQUENTIAL ’ , F i l e = ’ x y d a t a 2 . d a t ’ )
2536 ! HB/ Bingham / Measured
2537 Do i =1 , n2
2538 W r i t e ( 1 0 , ’ ( F9 . 3 , 1 x , F9 . 3 , 1 x , F9 . 3 , 1 x , F9 . 3 ) ’ ) x d a t a 2 ( i ) , y d a t a 2 ( i ) , y d a t a 3 ( i ) , y d a t a 4 ( i )
2539 End do
2540
2541 C l o s e ( 1 0 , S t a t u s = ’KEEP ’ )
2542
2543 ! C r e a t e g n u p l o t command f i l e
2544 ! −−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−
2545 Open ( 1 0 , ACCESS= ’SEQUENTIAL ’ , FILE= ’ gp . t x t ’ )
2546 W r i t e ( 1 0 , * ) ’ s e t t e r m i n a l png s i z e 2 4 0 0 , 2 4 0 0 ’ ! Sets i t to create .
png
2547
2548 W r i t e ( F i l e n a m e , ’ (A, I 2 . 2 ,A) ’ ) t r i m ( ID ) / / ’ P l o t S c e n a r i o ’ , S c e n a r i o , ’ . png ’
2549 W r i t e ( 1 0 , ’ (A) ’ ) ’ s e t o u t p u t ’ / / ’ " ’ / / ’D : / h i j n e k a m / D e s k t o p / Program / G r a p h s / S a m p l e s / ’ / / t r i m (
filename ) / / ’" ’ ! C r e a t e s . png f i l e and s t o r e s i t i n a d i f f e r e n t f o l d e r . The " / " u s e d
i s d i f f e r e n t from t h e d e f a u l t o r f o r t r a n ( " \ " ) ! ! !
2550
2551 Write (10 , * ) ’ s e t m u l t i p l o t title ’ / / ’ " { / : Bold ’ / / t r i m ( f i l e n a m e ) / / ’ } " f o n t " , 2 2 " ’
196 E. Code of the SampleSource Program
2552 Write (10 , * ) ’ s e t title ’ / / ’ " { / : Bold ’ / / ’ Alpha v s . D e l t a } " ’ ! Graph T i t l e , t i t l e i n bold ,
2553
2554 ! Write (10 ,8) ’ s e t xdata ’
2555
2556 W r i t e ( 1 0 , * ) ’ s e t x l a b e l ’ / / ’ " ’ / / TRIM ( x l a b e l 1 ) / / ’ " ’ ! Offset changes the p o s i t i o n of
t h e t i t l e , i n t h i s c a s e l o w e r s i t , w / o i t t h e t i t l e and t i c l a b e l s o v e r l a p . F i r s t number
o f f s e t s the horizontal position .
2557 W r i t e ( 1 0 , * ) ’ s e t y l a b e l ’ / / ’ " ’ / / TRIM ( y l a b e l 1 ) / / ’ " ’
2558
2559 Write (10 , * ) ’ s e t s i z e 0 . 5 , 0 . 5 ’
2560 Write (10 , * ) ’ s e t o r i g i n 0 . 0 , 0 . 0 ’
2561
2562 W r i t e ( 1 0 , * ) ’ s e t key o p a q u e r i g h t t o p box ’
2563
2564 Write (10 , * ) ’ s e t g r i d ’
2565
2566 write (10 , * ) ’ s e t xrange [ * : * ] ’
2567 Write (10 , * ) ’ s e t yrange [ 0 : * ] ’ ! F o r c e s t h e minimum o f
t h e y − a x i s t o be 0 w h i l e t h e u p p e r l i m i t i s still flexible .
2568
2569 C a l l GraphStyle ( Style1 , Layout1 )
2570
2571 ! C a l l GraphStyle ( Style2 , Layout2 )
2572
2573 W r i t e ( 1 0 , ’ (A) ’ ) ’ p l o t " x y d a t a 1 . d a t " u s i n g 1 : 2 w i t h ’ / / L a y o u t 1 / / ’ t i t l e " ’ / / TRIM ( g _ t i t l e 1 ) / / ’ "
’ ! B e c a u s e G n u p l o t r e a d s t i m e and d a t a a s two s e p a r a t e c o l u m n s t h e y − d a t a becomes
column 3 .
2574
2575 ! Now we s e t the o p t i o n s f o r the second p l o t
2576 Write (10 , * ) ’ set size 0.5 ,0.5 ’
2577 Write (10 , * ) ’ set origin 0.5 ,0.0 ’
2578 Write (10 , * ) ’ s e t t i t l e ’ / / ’ " { / : Bold ’ / / t i t l e 2 / / ’ } " ’
2579
2580 write (10 , * ) ’ s e t xrange [ * : * ] ’
2581 Write (10 , * ) ’ s e t yrange [ 0 : * ] ’
2582
2583 W r i t e ( 1 0 , * ) ’ s e t x l a b e l ’ / / ’ " ’ / / TRIM ( x l a b e l 2 ) / / ’ " ’
2584 W r i t e ( 1 0 , * ) ’ s e t y l a b e l ’ / / ’ " ’ / / TRIM ( y l a b e l 2 ) / / ’ " ’
2585
2586 W r i t e ( 1 0 , * ) ’ s e t key o p a q u e r i g h t b o t t o m box ’
2587
2588 Write (10 , * ) ’ s e t g r i d ’
2589
2590 C a l l GraphStyle ( Style2 , Layout2 )
2591 C a l l GraphStyle ( Style3 , Layout3 )
2592 C a l l GraphStyle ( Style4 , Layout4 )
2593
2594 ! L a r g e p l o t w i t h zoomed a x i s .
2595 W r i t e ( 1 0 , ’ (A) ’ ) ’ p l o t " x y d a t a 2 . d a t " u s i n g 1 : 2 w i t h ’ / / L a y o u t 2 / / ’ t i t l e " ’ / / TRIM ( g _ t i t l e 2 ) / / ’
" , " x y d a t a 2 . d a t " u s i n g 1 : 3 w i t h ’ / / L a y o u t 3 / / ’ t i t l e " ’ / / TRIM ( g _ t i t l e 3 ) / / ’ " , " x y d a t a 2 . d a t "
u s i n g 1 : 4 w i t h ’ / / L a y o u t 4 / / ’ t i t l e " ’ / / TRIM ( g _ t i t l e 4 ) / / ’ " ’
2596
2597 Write (10 , * ) ’ s e t xdata time ’
2598 W r i t e ( 1 0 , * ) ’ s e t t i m e f m t ’ ’%d−%m−%Y %H:%M:%S ’ ’ ’
2599
2600 W r i t e ( 1 0 , * ) ’ s e t t i t l e ’ / / ’ " { / : Bold ’ / / ’ I n t e r s e c t i o n } " ’ ! Graph T i t l e , t i t l e i n b o l d ,
works
2601 W r i t e ( 1 0 , * ) ’ s e t x l a b e l ’ / / ’ " ’ / / TRIM ( x l a b e l 0 ) / / ’ " o f f s e t 0 , − 1 ’ ! Offset changes the
p o s i t i o n o f t h e t i t l e , i n t h i s c a s e l o w e r s i t , w / o i t t h e t i t l e and t i c l a b e l s o v e r l a p .
F i r s t number o f f s e t s t h e h o r i z o n t a l p o s i t i o n .
2602 W r i t e ( 1 0 , * ) ’ s e t y l a b e l ’ / / ’ " ’ / / TRIM ( y l a b e l 0 ) / / ’ " ’
2603 W r i t e ( 1 0 , * ) ’ s e t y t i c s 500 ’
2604 Write (10 , * ) ’ s e t mytics 5 ’
2605
2606 Write (10 , * ) ’ s e t s i z e 1 ,0.49 ’
2607 Write (10 , * ) ’ s e t o r i g i n 0.0 ,0.49 ’
2608
2609 Write (10 , * ) ’ s e t g r i d mytics y t i c s x t i c s ’
2610
2611 W r i t e ( 1 0 , * ) ’ s e t key o p a q u e r i g h t b o t t o m box ’
2612
197
2741 I f ( P r e s e n t ( I n d e x ) ) Then
2742 W r i t e ( 1 0 , ’ (A, I2 , A) ’ ) ’ s e t s t y l e l i n e ’ , I n d e x , ’ l c r g b " o r a n g e " l t 1 lw 2 p t 7 p s 1 ’
2743 Else
2744 W r i t e ( 1 0 , ’ (A) ’ ) ’ s e t s t y l e l i n e 3 l c r g b " o r a n g e " l t 1 lw 2 p t 7 p s 1 ’
2745 End I f
2746
2747 Case ( ’ 1 d ’ )
2748 Layout = ’ l i n e s l s 4 ’
2749 I f ( P r e s e n t ( I n d e x ) ) W r i t e ( Layout , ’ (A, I 2 ) ’ ) ’ l i n e s l s ’ , I n d e x
2750 I f ( P r e s e n t ( I n d e x ) ) Then
2751 W r i t e ( 1 0 , ’ (A, I2 , A) ’ ) ’ s e t s t y l e l i n e ’ , I n d e x , ’ l c r g b " d a r k − g r e e n " l t 1 lw 2 p t 7 p s
1’
2752 Else
2753 W r i t e ( 1 0 , ’ (A) ’ ) ’ s e t s t y l e l i n e 4 l c r g b " d a r k − g r e e n " l t 1 lw 2 p t 7 p s 1 ’
2754 End I f
2755
2756 Case ( ’ 1 e ’ )
2757 Layout = ’ l i n e s l s 5 ’
2758 I f ( P r e s e n t ( I n d e x ) ) W r i t e ( Layout , ’ (A, I 2 ) ’ ) ’ l i n e s l s ’ , I n d e x
2759 I f ( P r e s e n t ( I n d e x ) ) Then
2760 W r i t e ( 1 0 , ’ (A, I2 , A) ’ ) ’ s e t s t y l e l i n e ’ , I n d e x , ’ l c r g b " m a g e n t a " l t 1 lw 2 p t 7 p s 1 ’
2761 Else
2762 W r i t e ( 1 0 , ’ (A) ’ ) ’ s e t s t y l e l i n e 5 l c r g b " m a g e n t a " l t 1 lw 2 p t 7 p s 1 ’
2763 End I f
2764
2765 Case ( ’ 1 f ’ )
2766 Layout = ’ l i n e s l s 6 ’
2767 I f ( P r e s e n t ( I n d e x ) ) W r i t e ( Layout , ’ (A, I 2 ) ’ ) ’ l i n e s l s ’ , I n d e x
2768 I f ( P r e s e n t ( I n d e x ) ) Then
2769 W r i t e ( 1 0 , ’ (A, I2 , A) ’ ) ’ s e t s t y l e l i n e ’ , I n d e x , ’ l c r g b " s a n d y b r o w n " l t 1 lw 2 p t 7 p s
1’
2770 Else
2771 W r i t e ( 1 0 , ’ (A) ’ ) ’ s e t s t y l e l i n e 6 l c r g b " s a n d y b r o w n " l t 1 lw 2 p t 7 p s 1 ’
2772 End I f
2773
2774 Case ( ’ 1 g ’ )
2775 Layout = ’ l i n e s l s 7 ’
2776 I f ( P r e s e n t ( I n d e x ) ) W r i t e ( Layout , ’ (A, I 2 ) ’ ) ’ l i n e s l s ’ , I n d e x
2777 I f ( P r e s e n t ( I n d e x ) ) Then
2778 W r i t e ( 1 0 , ’ (A, I2 , A) ’ ) ’ s e t s t y l e l i n e ’ , I n d e x , ’ l c r g b " o r a n g e − r e d " l t 1 lw 2 p t 7 p s
1’
2779 Else
2780 W r i t e ( 1 0 , ’ (A) ’ ) ’ s e t s t y l e l i n e 7 l c r g b " o r a n g e − r e d " l t 1 lw 2 p t 7 p s 1 ’
2781 End I f
2782
2783 Case ( ’ 1 h ’ )
2784 Layout = ’ l i n e s l s 8 ’
2785 I f ( P r e s e n t ( I n d e x ) ) W r i t e ( Layout , ’ (A, I 2 ) ’ ) ’ l i n e s l s ’ , I n d e x
2786 I f ( P r e s e n t ( I n d e x ) ) Then
2787 W r i t e ( 1 0 , ’ (A, I2 , A) ’ ) ’ s e t s t y l e l i n e ’ , I n d e x , ’ l c r g b " s p r i n g − g r e e n " l t 1 lw 2 p t 7
ps 1 ’
2788 Else
2789 W r i t e ( 1 0 , ’ (A) ’ ) ’ s e t s t y l e l i n e 8 l c r g b " s p r i n g − g r e e n " l t 1 lw 2 p t 7 p s 1 ’
2790 End I f
2791
2792 Case ( ’ 1 i ’ )
2793 Layout = ’ l i n e s l s 9 ’
2794 I f ( P r e s e n t ( I n d e x ) ) W r i t e ( Layout , ’ (A, I 2 ) ’ ) ’ l i n e s l s ’ , I n d e x
2795 I f ( P r e s e n t ( I n d e x ) ) Then
2796 W r i t e ( 1 0 , ’ (A, I2 , A) ’ ) ’ s e t s t y l e l i n e ’ , I n d e x , ’ l c r g b " c y a n " l t 1 lw 2 p t 7 p s 1 ’
2797 Else
2798 W r i t e ( 1 0 , ’ (A) ’ ) ’ s e t s t y l e l i n e 9 l c r g b " c y a n " l t 1 lw 2 p t 7 p s 1 ’
2799 End I f
2800
2801 Case ( ’ 1 j ’ )
2802 L a y o u t = ’ l i n e s l s 10 ’
2803 I f ( P r e s e n t ( I n d e x ) ) W r i t e ( Layout , ’ (A, I 2 ) ’ ) ’ l i n e s l s ’ , I n d e x
2804 I f ( P r e s e n t ( I n d e x ) ) Then
2805 W r i t e ( 1 0 , ’ (A, I2 , A) ’ ) ’ s e t s t y l e l i n e ’ , I n d e x , ’ l c r g b " k h a k i " l t 1 lw 2 p t 7 p s 1 ’
2806 Else
2807 W r i t e ( 1 0 , ’ (A) ’ ) ’ s e t s t y l e l i n e 10 l c r g b " k h a k i " l t 1 lw 2 p t 7 p s 1 ’
200 E. Code of the SampleSource Program
2808 End I f
2809
2810 Case ( ’ 1 k ’ ) ! Redish
2811 L a y o u t = ’ l i n e s l s 11 ’
2812 I f ( P r e s e n t ( I n d e x ) ) W r i t e ( Layout , ’ (A, I 2 ) ’ ) ’ l i n e s l s ’ , I n d e x
2813 I f ( P r e s e n t ( I n d e x ) ) Then
2814 W r i t e ( 1 0 , ’ (A, I2 , A) ’ ) ’ s e t s t y l e l i n e ’ , I n d e x , ’ l c r g b ’ ’ # d d 1 8 1 f ’ ’ l t 1 lw 3 p t 7 p s 1
’
2815 Else
2816 W r i t e ( 1 0 , ’ (A) ’ ) ’ s e t s t y l e l i n e 11 l c r g b ’ ’ # d d 1 8 1 f ’ ’ l t 1 lw 3 p t 7 p s 1 ’
2817 End I f
2818
2819 Case ( ’ 1 l ’ )
2820 L a y o u t = ’ l i n e s l s 12 ’
2821 I f ( P r e s e n t ( I n d e x ) ) W r i t e ( Layout , ’ (A, I 2 ) ’ ) ’ l i n e s l s ’ , I n d e x
2822 I f ( P r e s e n t ( I n d e x ) ) Then
2823 W r i t e ( 1 0 , ’ (A, I2 , A) ’ ) ’ s e t s t y l e l i n e ’ , I n d e x , ’ l c r g b " d a r k − b l u e " l t 1 lw 3 p t 7 p s 1
’
2824 Else
2825 W r i t e ( 1 0 , ’ (A) ’ ) ’ s e t s t y l e l i n e 12 l c r g b " d a r k − b l u e " l t 1 lw 3 p t 7 p s 1 ’
2826 End I f
2827
2828 Case ( ’ 1m’ )
2829 L a y o u t = ’ l i n e s l s 13 ’
2830 I f ( P r e s e n t ( I n d e x ) ) W r i t e ( Layout , ’ (A, I 2 ) ’ ) ’ l i n e s l s ’ , I n d e x
2831 I f ( P r e s e n t ( I n d e x ) ) Then
2832 W r i t e ( 1 0 , ’ (A, I2 , A) ’ ) ’ s e t s t y l e l i n e ’ , I n d e x , ’ l c r g b " o r a n g e " l t 1 lw 3 p t 7 p s 1 ’
2833 Else
2834 W r i t e ( 1 0 , ’ (A) ’ ) ’ s e t s t y l e l i n e 13 l c r g b " o r a n g e " l t 1 lw 3 p t 7 p s 1 ’
2835 End I f
2836
2837 Case ( ’ 1 n ’ )
2838 L a y o u t = ’ l i n e s l s 14 ’
2839 I f ( P r e s e n t ( I n d e x ) ) W r i t e ( Layout , ’ (A, I 2 ) ’ ) ’ l i n e s l s ’ , I n d e x
2840 I f ( P r e s e n t ( I n d e x ) ) Then
2841 W r i t e ( 1 0 , ’ (A, I2 , A) ’ ) ’ s e t s t y l e l i n e ’ , I n d e x , ’ l c r g b " d a r k − g r e e n " l t 1 lw 3 p t 7 p s
1’
2842 Else
2843 W r i t e ( 1 0 , ’ (A) ’ ) ’ s e t s t y l e l i n e 14 l c r g b " d a r k − g r e e n " l t 1 lw 3 p t 7 p s 1 ’
2844 End I f
2845
2846 Case ( ’ 1 o ’ )
2847 L a y o u t = ’ l i n e s l s 15 ’
2848 I f ( P r e s e n t ( I n d e x ) ) W r i t e ( Layout , ’ (A, I 2 ) ’ ) ’ l i n e s l s ’ , I n d e x
2849 I f ( P r e s e n t ( I n d e x ) ) Then
2850 W r i t e ( 1 0 , ’ (A, I2 , A) ’ ) ’ s e t s t y l e l i n e ’ , I n d e x , ’ l c r g b " m a g e n t a " l t 1 lw 3 p t 7 p s 1 ’
2851 Else
2852 W r i t e ( 1 0 , ’ (A) ’ ) ’ s e t s t y l e l i n e 15 l c r g b " m a g e n t a " l t 1 lw 3 p t 7 p s 1 ’
2853 End I f
2854
2855 Case ( ’ 1 p ’ )
2856 L a y o u t = ’ l i n e s l s 16 ’
2857 I f ( P r e s e n t ( I n d e x ) ) W r i t e ( Layout , ’ (A, I 2 ) ’ ) ’ l i n e s l s ’ , I n d e x
2858 I f ( P r e s e n t ( I n d e x ) ) Then
2859 W r i t e ( 1 0 , ’ (A, I2 , A) ’ ) ’ s e t s t y l e l i n e ’ , I n d e x , ’ l c r g b " s a n d y b r o w n " l t 1 lw 3 p t 7 p s
1’
2860 Else
2861 W r i t e ( 1 0 , ’ (A) ’ ) ’ s e t s t y l e l i n e 16 l c r g b " s a n d y b r o w n " l t 1 lw 3 p t 7 p s 1 ’
2862 End I f
2863
2864 Case ( ’ 1 q ’ )
2865 L a y o u t = ’ l i n e s l s 17 ’
2866 I f ( P r e s e n t ( I n d e x ) ) W r i t e ( Layout , ’ (A, I 2 ) ’ ) ’ l i n e s l s ’ , I n d e x
2867
2868 I f ( P r e s e n t ( I n d e x ) ) Then
2869 W r i t e ( 1 0 , ’ (A, I2 , A) ’ ) ’ s e t s t y l e l i n e ’ , I n d e x , ’ l c r g b " o r a n g e − r e d " l t 1 lw 3 p t 7 p s
1’
2870 Else
2871 W r i t e ( 1 0 , ’ (A) ’ ) ’ s e t s t y l e l i n e 17 l c r g b " o r a n g e − r e d " l t 1 lw 3 p t 7 p s 1 ’
2872 End I f
2873
201
2874 Case ( ’ 1 r ’ )
2875 L a y o u t = ’ l i n e s l s 18 ’
2876 I f ( P r e s e n t ( I n d e x ) ) W r i t e ( Layout , ’ (A, I 2 ) ’ ) ’ l i n e s l s ’ , I n d e x
2877 I f ( P r e s e n t ( I n d e x ) ) Then
2878 W r i t e ( 1 0 , ’ (A, I2 , A) ’ ) ’ s e t s t y l e l i n e ’ , I n d e x , ’ l c r g b " s p r i n g − g r e e n " l t 1 lw 3 p t 7
ps 1 ’
2879 Else
2880 W r i t e ( 1 0 , ’ (A) ’ ) ’ s e t s t y l e l i n e 18 l c r g b " s p r i n g − g r e e n " l t 1 lw 3 p t 7 p s 1 ’
2881 End I f
2882
2883 Case ( ’ 1 s ’ )
2884 L a y o u t = ’ l i n e s l s 19 ’
2885 I f ( P r e s e n t ( I n d e x ) ) W r i t e ( Layout , ’ (A, I 2 ) ’ ) ’ l i n e s l s ’ , I n d e x
2886 I f ( P r e s e n t ( I n d e x ) ) Then
2887 W r i t e ( 1 0 , ’ (A, I2 , A) ’ ) ’ s e t s t y l e l i n e ’ , I n d e x , ’ l c r g b " c y a n " l t 1 lw 3 p t 7 p s 1 ’
2888 Else
2889 W r i t e ( 1 0 , ’ (A) ’ ) ’ s e t s t y l e l i n e 19 l c r g b " c y a n " l t 1 lw 3 p t 7 p s 1 ’
2890 End I f
2891
2892 Case ( ’ 1 t ’ )
2893 L a y o u t = ’ l i n e s l s 20 ’
2894 I f ( P r e s e n t ( I n d e x ) ) W r i t e ( Layout , ’ (A, I 2 ) ’ ) ’ l i n e s l s ’ , I n d e x
2895 I f ( P r e s e n t ( I n d e x ) ) Then
2896 W r i t e ( 1 0 , ’ (A, I2 , A) ’ ) ’ s e t s t y l e l i n e ’ , I n d e x , ’ l c r g b " k h a k i " l t 1 lw 3 p t 7 p s 1 ’
2897 Else
2898 W r i t e ( 1 0 , ’ (A) ’ ) ’ s e t s t y l e l i n e 20 l c r g b " k h a k i " l t 1 lw 3 p t 7 p s 1 ’
2899 End I f
2900
2901 Case ( ’ 1 u ’ )
2902 L a y o u t = ’ l i n e s l s 21 ’
2903 I f ( P r e s e n t ( I n d e x ) ) W r i t e ( Layout , ’ (A, I 2 ) ’ ) ’ l i n e s l s ’ , I n d e x
2904 I f ( P r e s e n t ( I n d e x ) ) Then
2905 W r i t e ( 1 0 , ’ (A, I2 , A) ’ ) ’ s e t s t y l e l i n e ’ , I n d e x , ’ l c r g b " b i s q u e " l t 1 lw 3 p t 7 p s 1 ’
2906 Else
2907 W r i t e ( 1 0 , ’ (A) ’ ) ’ s e t s t y l e l i n e 21 l c r g b " b i s q u e " l t 1 lw 3 p t 7 p s 1 ’
2908 End I f
2909
2910 Case ( ’ 1 v ’ )
2911 L a y o u t = ’ l i n e s l s 22 ’
2912 I f ( P r e s e n t ( I n d e x ) ) W r i t e ( Layout , ’ (A, I 2 ) ’ ) ’ l i n e s l s ’ , I n d e x
2913 I f ( P r e s e n t ( I n d e x ) ) Then
2914 W r i t e ( 1 0 , ’ (A, I2 , A) ’ ) ’ s e t s t y l e l i n e ’ , I n d e x , ’ l c r g b " plum " l t 1 lw 3 p t 7 p s 1 ’
2915 Else
2916 W r i t e ( 1 0 , ’ (A) ’ ) ’ s e t s t y l e l i n e 22 l c r g b " plum " l t 1 lw 3 p t 7 p s 1 ’
2917 End I f
2918
2919 Case ( ’ 1w ’ )
2920 L a y o u t = ’ l i n e s l s 23 ’
2921 I f ( P r e s e n t ( I n d e x ) ) W r i t e ( Layout , ’ (A, I 2 ) ’ ) ’ l i n e s l s ’ , I n d e x
2922 I f ( P r e s e n t ( I n d e x ) ) Then
2923 W r i t e ( 1 0 , ’ (A, I2 , A) ’ ) ’ s e t s t y l e l i n e ’ , I n d e x , ’ l c r g b " medium − b l u e " l t 1 lw 3 p t 7 p s
1’
2924 Else
2925 W r i t e ( 1 0 , ’ (A) ’ ) ’ s e t s t y l e l i n e 23 l c r g b " medium − b l u e " l t 1 lw 3 p t 7 p s 1 ’
2926 End I f
2927
2928 Case ( ’ 1 x ’ )
2929 L a y o u t = ’ l i n e s l s 24 ’
2930 I f ( P r e s e n t ( I n d e x ) ) W r i t e ( Layout , ’ (A, I 2 ) ’ ) ’ l i n e s l s ’ , I n d e x
2931 I f ( P r e s e n t ( I n d e x ) ) Then
2932 W r i t e ( 1 0 , ’ (A, I2 , A) ’ ) ’ s e t s t y l e l i n e ’ , I n d e x , ’ l c r g b " d a r k − o r a n g e " l t 1 lw 3 p t 7 p s
1’
2933 Else
2934 W r i t e ( 1 0 , ’ (A) ’ ) ’ s e t s t y l e l i n e 24 l c r g b " d a r k − o r a n g e " l t 1 lw 3 p t 7 p s 1 ’
2935 End I f
2936
2937 Case ( ’ 1 y ’ )
2938 L a y o u t = ’ l i n e s l s 25 ’
2939 I f ( P r e s e n t ( I n d e x ) ) W r i t e ( Layout , ’ (A, I 2 ) ’ ) ’ l i n e s l s ’ , I n d e x
2940 I f ( P r e s e n t ( I n d e x ) ) Then
2941 W r i t e ( 1 0 , ’ (A, I2 , A) ’ ) ’ s e t s t y l e l i n e ’ , I n d e x , ’ l c r g b " d a r k − plum " l t 1 lw 3 p t 7 p s 1
202 E. Code of the SampleSource Program
’
2942 Else
2943 W r i t e ( 1 0 , ’ (A) ’ ) ’ s e t s t y l e l i n e 25 l c r g b " d a r k − plum " l t 1 lw 3 p t 7 p s 1 ’
2944 End I f
2945
2946 Case ( ’ 1 z ’ )
2947 L a y o u t = ’ l i n e s l s 26 ’
2948 I f ( P r e s e n t ( I n d e x ) ) W r i t e ( Layout , ’ (A, I 2 ) ’ ) ’ l i n e s l s ’ , I n d e x
2949 I f ( P r e s e n t ( I n d e x ) ) Then
2950 W r i t e ( 1 0 , ’ (A, I2 , A) ’ ) ’ s e t s t y l e l i n e ’ , I n d e x , ’ l c r g b " d a r k − g o l d e n r o d " l t 1 lw 3 p t 7
ps 1 ’
2951 Else
2952 W r i t e ( 1 0 , ’ (A) ’ ) ’ s e t s t y l e l i n e 26 l c r g b " d a r k − g o l d e n r o d " l t 1 lw 3 p t 7 p s 1 ’
2953 End I f
2954
2955
2956 Case ( ’ 2 a ’ )
2957 Layout = ’ lp l s 1 ’
2958 W r i t e ( 1 0 , ’ (A) ’ ) ’ s e t s t y l e l i n e 1 l c r g b " r e d " l t 1 lw 2 p t 7 p s 1 ’
2959
2960 Case ( ’ 2 b ’ )
2961 Layout = ’ lp l s 2 ’
2962 W r i t e ( 1 0 , ’ (A) ’ ) ’ s e t s t y l e l i n e 2 l c r g b " d a r k − b l u e " l t 1 lw 2 p t 7 p s 1 ’
2963
2964 Case ( ’ 2 c ’ )
2965 Layout = ’ lp l s 3 ’
2966 W r i t e ( 1 0 , ’ (A) ’ ) ’ s e t s t y l e l i n e 3 l c r g b " o r a n g e " l t 1 lw 2 p t 7 p s 1 ’
2967
2968 Case ( ’ 2 d ’ )
2969 Layout = ’ lp l s 4 ’
2970 W r i t e ( 1 0 , ’ (A) ’ ) ’ s e t s t y l e l i n e 4 l c r g b " d a r k − b l u e " l t 1 lw 3 p t 7 p s 2 ’
2971
2972 Case ( ’ 2 e ’ )
2973 Layout = ’ lp l s 5 ’
2974 W r i t e ( 1 0 , ’ (A) ’ ) ’ s e t s t y l e l i n e 5 l c r g b " d a r k − r e d " l t 1 lw 2 p t 7 p s 1 ’
2975
2976 Case ( ’ 2 f ’ )
2977 Layout = ’ lp l s 6 ’
2978 W r i t e ( 1 0 , ’ (A) ’ ) ’ s e t s t y l e l i n e 6 l c r g b " o r a n g e − r e d " l t 1 lw 2 p t 7 p s 1 ’
2979
2980 Case ( ’ 2 g ’ )
2981 Layout = ’ lp l s 7 ’
2982 W r i t e ( 1 0 , ’ (A) ’ ) ’ s e t s t y l e l i n e 7 l c r g b " t a n 1 " l t 1 lw 2 p t 7 p s 1 ’
2983
2984 Case ( ’ 2 h ’ )
2985 Layout = ’ lp l s 8 ’
2986 W r i t e ( 1 0 , ’ (A) ’ ) ’ s e t s t y l e l i n e 8 l c r g b " d a r k − g r e e n " l t 1 lw 2 p t 7 p s 1 ’
2987
2988 Case ( ’ 2 i ’ )
2989 Layout = ’ lp l s 9 ’
2990 W r i t e ( 1 0 , ’ (A) ’ ) ’ s e t s t y l e l i n e 9 l c r g b " g r e e n " l t 1 lw 2 p t 7 p s 1 ’
2991
2992 Case ( ’ 2 j ’ )
2993 L a y o u t = ’ l p l s 10 ’
2994 W r i t e ( 1 0 , ’ (A) ’ ) ’ s e t s t y l e l i n e 10 l c r g b " c h a r t r e u s e " l t 1 lw 2 p t 7 p s 1 ’
2995
2996 Case ( ’ 2 k ’ )
2997 L a y o u t = ’ l p l s 11 ’
2998 W r i t e ( 1 0 , ’ (A) ’ ) ’ s e t s t y l e l i n e 11 l c r g b " d a r k − g o l d e n r o d " l t 1 lw 2 p t 7 p s 1 ’
2999
3000 Case ( ’ 2 l ’ )
3001 L a y o u t = ’ l p l s 12 ’
3002 W r i t e ( 1 0 , ’ (A) ’ ) ’ s e t s t y l e l i n e 12 l c r g b " o r a n g e " l t 1 lw 2 p t 7 p s 1 ’
3003
3004 Case ( ’ 2m’ )
3005 L a y o u t = ’ l p l s 13 ’
3006 W r i t e ( 1 0 , ’ (A) ’ ) ’ s e t s t y l e l i n e 13 l c r g b " g o l d " l t 1 lw 2 p t 7 p s 1 ’
3007
3008 Case ( ’ 2 n ’ )
3009 L a y o u t = ’ l p l s 13 ’
3010 W r i t e ( 1 0 , ’ (A) ’ ) ’ s e t s t y l e l i n e 13 l c r g b " o r a n g e − r e d " l t 1 lw 1 p t 7 p s 2 ’
203
3011
3012 Case ( ’ 2 o ’ )
3013 L a y o u t = ’ l p l s 12 ’
3014 W r i t e ( 1 0 , ’ (A) ’ ) ’ s e t s t y l e l i n e 12 l c r g b " web− g r e e n " l t 1 lw 1 p t 7 p s 2 ’
3015
3016
3017 Case ( ’ 3 a ’ )
3018 Layout = ’ p o i n t s l s 1 ’
3019 W r i t e ( 1 0 , ’ (A) ’ ) ’ s e t s t y l e l i n e 1 l c r g b " r e d " l t 1 lw 3 p t 6 p s 2 ’
3020
3021 Case ( ’ 3 b ’ )
3022 Layout = ’ p o i n t s l s 2 ’
3023 W r i t e ( 1 0 , ’ (A) ’ ) ’ s e t s t y l e l i n e 2 l c r g b " d a r k − b l u e " l t 1 lw 3 p t 6 p s 2 ’
3024
3025 Case ( ’ 3 c ’ )
3026 Layout = ’ p o i n t s l s 3 ’
3027 W r i t e ( 1 0 , ’ (A) ’ ) ’ s e t s t y l e l i n e 3 l c r g b " o r a n g e " l t 1 lw 3 p t 6 p s 2 ’
3028
3029 Case ( ’ 3 d ’ )
3030 Layout = ’ p o i n t s l s 4 ’
3031 W r i t e ( 1 0 , ’ (A) ’ ) ’ s e t s t y l e l i n e 4 l c r g b " d a r k − g r e e n " l t 1 lw 1 p t 6 p s 2 ’
3032
3033 Case ( ’ 3 e ’ )
3034 Layout = ’ p o i n t s l s 5 ’
3035 W r i t e ( 1 0 , ’ (A) ’ ) ’ s e t s t y l e l i n e 5 l c r g b " m a g e n t a " l t 1 lw 1 p t 6 p s 2 ’
3036
3037 Case ( ’ 3 f ’ )
3038 Layout = ’ p o i n t s l s 6 ’
3039 W r i t e ( 1 0 , ’ (A) ’ ) ’ s e t s t y l e l i n e 6 l c r g b " s a n d y b r o w n " l t 1 lw 1 p t 6 p s 2 ’
3040
3041 Case ( ’ 3 g ’ )
3042 Layout = ’ p o i n t s l s 7 ’
3043 W r i t e ( 1 0 , ’ (A) ’ ) ’ s e t s t y l e l i n e 7 l c r g b " o r a n g e − r e d " l t 1 lw 1 p t 6 p s 2 ’
3044
3045 Case ( ’ 3 h ’ )
3046 Layout = ’ p o i n t s l s 8 ’
3047 W r i t e ( 1 0 , ’ (A) ’ ) ’ s e t s t y l e l i n e 8 l c r g b " s p r i n g − g r e e n " l t 1 lw 1 p t 6 p s 2 ’
3048
3049 Case ( ’ 3 i ’ )
3050 Layout = ’ p o i n t s l s 9 ’
3051 W r i t e ( 1 0 , ’ (A) ’ ) ’ s e t s t y l e l i n e 9 l c r g b " c y a n " l t 1 lw 1 p t 6 p s 2 ’
3052
3053 Case ( ’ 3 j ’ )
3054 L a y o u t = ’ p o i n t s l s 10 ’
3055 W r i t e ( 1 0 , ’ (A) ’ ) ’ s e t s t y l e l i n e 10 l c r g b " k h a k i " l t 1 lw 1 p t 6 p s 2 ’
3056
3057 Case ( ’ 3 k ’ )
3058 L a y o u t = ’ p o i n t s l s 11 ’
3059 W r i t e ( 1 0 , ’ (A) ’ ) ’ s e t s t y l e l i n e 11 l c r g b " r e d " l t 1 lw 1 p t 6 p s 2 ’
3060
3061 Case ( ’ 3 l ’ )
3062 L a y o u t = ’ p o i n t s l s 12 ’
3063 W r i t e ( 1 0 , ’ (A) ’ ) ’ s e t s t y l e l i n e 12 l c r g b " d a r k − b l u e " l t 1 lw 1 p t 6 p s 2 ’
3064
3065 Case ( ’ 3m’ )
3066 L a y o u t = ’ p o i n t s l s 13 ’
3067 W r i t e ( 1 0 , ’ (A) ’ ) ’ s e t s t y l e l i n e 13 l c r g b " r e d " l t 1 lw 1 p t 7 p s 3 ’
3068
3069 Case ( ’ 3 n ’ )
3070 L a y o u t = ’ p o i n t s l s 14 ’
3071 W r i t e ( 1 0 , ’ (A) ’ ) ’ s e t s t y l e l i n e 14 l c r g b " d a r k − b l u e " l t 1 lw 1 p t 7 p s 3 ’
3072
3073 Case ( ’ 3 o ’ )
3074 L a y o u t = ’ p o i n t s l s 15 ’
3075 W r i t e ( 1 0 , ’ (A) ’ ) ’ s e t s t y l e l i n e 15 l c r g b " c h a r t r e u s e " l t 1 lw 1 p t 7 p s 3 ’
3076
3077 Case ( ’ 3 p ’ )
3078 L a y o u t = ’ p o i n t s l s 16 ’
3079 W r i t e ( 1 0 , ’ (A) ’ ) ’ s e t s t y l e l i n e 16 l c r g b " d a r k − g r e e n " l t 1 lw 1 p t 7 p s 3 ’
3080
3081 Case ( ’ 3 q ’ )
204 E. Code of the SampleSource Program
3082 L a y o u t = ’ p o i n t s l s 17 ’
3083 W r i t e ( 1 0 , ’ (A) ’ ) ’ s e t s t y l e l i n e 17 l c r g b " m a g e n t a " l t 1 lw 1 p t 7 p s 3 ’
3084
3085 Case ( ’ 3 r ’ )
3086 L a y o u t = ’ p o i n t s l s 18 ’
3087 W r i t e ( 1 0 , ’ (A) ’ ) ’ s e t s t y l e l i n e 18 l c r g b " s a n d y b r o w n " l t 1 lw 1 p t 7 p s 3 ’
3088
3089 Case ( ’ 3 s ’ )
3090 L a y o u t = ’ p o i n t s l s 19 ’
3091 W r i t e ( 1 0 , ’ (A) ’ ) ’ s e t s t y l e l i n e 19 l c r g b " c y a n " l t 1 lw 1 p t 7 p s 3 ’
3092
3093 Case ( ’ 3 t ’ )
3094 L a y o u t = ’ p o i n t s l s 20 ’
3095 W r i t e ( 1 0 , ’ (A) ’ ) ’ s e t s t y l e l i n e 20 l c r g b " o r a n g e " l t 1 lw 1 p t 7 p s 3 ’
3096
3097 Case ( ’ 3 u ’ )
3098 L a y o u t = ’ p o i n t s l s 21 ’
3099 W r i t e ( 1 0 , ’ (A) ’ ) ’ s e t s t y l e l i n e 21 l c r g b " d a r k − v i o l e t " l t 1 lw 1 p t 7 p s 3 ’
3100
3101 Case ( ’ 3 v ’ )
3102 L a y o u t = ’ p o i n t s l s 22 ’
3103 W r i t e ( 1 0 , ’ (A) ’ ) ’ s e t s t y l e l i n e 22 l c r g b " d a r k − g r e e n " l t 1 lw 3 p t 6 p s 2 ’
3104
3105 Case ( ’ 3w ’ )
3106 L a y o u t = ’ p o i n t s l s 23 ’
3107 W r i t e ( 1 0 , ’ (A) ’ ) ’ s e t s t y l e l i n e 23 l c r g b " o r a n g e − r e d " l t 1 lw 1 p t 7 p s 3 ’
3108
3109 Case ( ’ 3 x ’ )
3110 L a y o u t = ’ p o i n t s l s 24 ’
3111 W r i t e ( 1 0 , ’ (A) ’ ) ’ s e t s t y l e l i n e 24 l c r g b " c h a r t r e u s e " l t 1 lw 3 p t 6 p s 2 ’
3112
3113 Case ( ’ 3 y ’ )
3114 L a y o u t = ’ p o i n t s l s 25 ’
3115 W r i t e ( 1 0 , ’ (A) ’ ) ’ s e t s t y l e l i n e 25 l c r g b " d a r k − r e d " l t 1 lw 3 p t 6 p s 2 ’
3116
3117 Case ( ’ 3 z ’ )
3118 L a y o u t = ’ p o i n t s l s 26 ’
3119 W r i t e ( 1 0 , ’ (A) ’ ) ’ s e t s t y l e l i n e 26 l c r g b " d a r k − g r e e n " l t 1 lw 3 p t 6 p s 2 ’
3120
3121
3122 Case ( ’ 4 a ’ )
3123 Layout = ’ c i r c l e s l s 1 ’
3124 W r i t e ( 1 0 , ’ (A) ’ ) ’ s e t s t y l e l i n e 1 l c r g b " g r a y " lw 3 ’
3125
3126 Case ( ’ 4 b ’ )
3127 Layout = ’ c i r c l e s l s 2 ’
3128 W r i t e ( 1 0 , ’ (A) ’ ) ’ s e t s t y l e l i n e 2 l c r g b " r e d " lw 3 ’
3129
3130 Case ( ’ 4 c ’ )
3131 Layout = ’ c i r c l e s l s 3 ’
3132 W r i t e ( 1 0 , ’ (A) ’ ) ’ s e t s t y l e l i n e 3 l c r g b " l i g h t − g r e e n " lw 3 ’
3133
3134 Case ( ’ 4 d ’ )
3135 Layout = ’ c i r c l e s l s 4 ’
3136 W r i t e ( 1 0 , ’ (A) ’ ) ’ s e t s t y l e l i n e 4 l c r g b " p i n k " lw 3 ’
3137
3138 Case ( ’ 4 e ’ )
3139 Layout = ’ c i r c l e s l s 5 ’
3140 W r i t e ( 1 0 , ’ (A) ’ ) ’ s e t s t y l e l i n e 5 l c r g b " d a r k − g r a y " lw 3 ’
3141
3142 Case ( ’ 4 f ’ )
3143 Layout = ’ c i r c l e s l s 6 ’
3144 W r i t e ( 1 0 , ’ (A) ’ ) ’ s e t s t y l e l i n e 6 l c r g b "# d a r k − b l u e " lw 3 ’
3145
3146 Case ( ’ 4 g ’ )
3147 Layout = ’ c i r c l e s l s 7 ’
3148 W r i t e ( 1 0 , ’ (A) ’ ) ’ s e t s t y l e l i n e 7 l c r g b " d a r k − y e l l o w " lw 3 ’
3149
3150 Case ( ’ 4 h ’ )
3151 Layout = ’ c i r c l e s l s 8 ’
3152 W r i t e ( 1 0 , ’ (A) ’ ) ’ s e t s t y l e l i n e 8 l c r g b " o r a n g e " lw 3 ’
205
3153
3154
3155 Case ( ’ 5 a ’ )
3156 Layout = ’ boxes l s 1 ’
3157 W r i t e ( 1 0 , ’ (A) ’ ) ’ s e t s t y l e l i n e s 1 l c r g b " r e d " lw 3 ’
3158
3159 Case ( ’ 5 b ’ )
3160 Layout = ’ boxes l s 2 ’
3161 W r i t e ( 1 0 , ’ (A) ’ ) ’ s e t s t y l e l i n e s 2 l c r g b " d a r k − b l u e " lw 3 ’
3162
3163
3164 Case D e f a u l t
3165 W r i t e ( * , ’ (A) ’ ) " Graph S t y l e unknown , p r o c e s s a b o r t e d . "
3166 Return
3167
3168 End S e l e c t
3169
3170 End S u b r o u t i n e
3171
3172 ! −−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−
3173
3174 End Module S o u r c e M o d u l e
Code/SourceModule.f90
F
Code of the MarsdiepVisual Program
This appendix contains the full code of the MarsdiepVisual program written for this thesis. The code is as used,
which means that it is far from optimized and parts may be present but no longer in use.
1 ! ****************************************************************************
2 ! PROGRAM: MarsdiepVisual
3 !
4 ! PURPOSE : D i f f e r e n t Options are a v a i l a b l e :
5 ! * O p t i o n 1 c r e a t e s p l o t s b a s e d on t h e f l u i d p r o p e r t i e s ( m e a s u r e m e n t s ) .
6 ! * O p t i o n 2 i s b a s e d on t h e ( c a l c u l a t e d ) r e s u l t s o f b o t h l o c a t i o n s . Those
r e s u l t s a r e not c a l c u l a t e d i n t h i s program .
7 ! * O p t i o n 3 i s b a s e d on t h e s i e v e d a t a g a i n e d i n t h e L a b o r a t o r y a t D e l t a r e s
o r on c a l c u l a t i o n s made i n t h e S a m p l e S o u r c e p r o g r a m .
8 ! * O p t i o n 4 i s b a s e d on t h e r e s u l t i n g d a t a from t h e S a m p l e S o u r c e program ,
scenarios option .
9 ! * O p t i o n 5 i s c o m b i n e s f i l e s from t h e d i f f e r e n t s c e n a r i o s i n t o 1 f i l e f o r
all scenarios .
10 ! * O p t i o n 6 i s c r e a t i n g a g r a p h b a s e d on t h e d i f f e r e n t c a l c u l a t e d l o c a t i o n s
and t h e s a m p l e i d e n t i f i c a t i o n r e s u l t s .
11 !
12 ! ****************************************************************************
13
14 Program M a r s d i e p V i s u a l
15
16 Use V i s u a l M o d u l e
17
18 I m p l i c i t None
19
20 ! Variables
21 ! −−−−−−−−−−−−−−−−−−−−−−
22
23 ! Run V a r i a b l e ( s )
24 Integer :: Option
25 Integer :: i , j , k , l , m, I n d e x
26 Integer :: RunOption
27 Integer :: EndOption
28 Integer :: Counter
29 Integer : : WCounter
30
31 ! File Variable ( s )
32 Character (*) , Parameter :: filefolder_in = "D : \ h i j n e k a m \ D e s k t o p \ Program \
ProgramInput \ " ! Inputfiles
33 Character (*) , Parameter :: filefolder_out = "D : \ h i j n e k a m \ D e s k t o p \ Program \
ProgramOutput \ " ! O u t p u t f i l e s of t h e SampleSource , used as i n p u t f i l e s f o r t h i s
program .
34
35 Integer :: InputCSV_Sur =1 , S i e v e R e s u l t s =3 , S i e v e R e s u l t s _ V =4 , InputCSV_Sur_DH =5 ,
InputCSV_Sur_T =6 , S i e v e R e s u l t s _ O l d =99 , FormationsTNO =7
36 Integer :: O u t p u t S a m p l e s _ T =21 , OutputSamples_DH =22 , O u t p u t F o r m S i e v e =23 ,
O u t p u t S a m p l e s L o c _ T _ T x t =24 , OutputSamplesLoc_DH_Txt =25 , O u t p u t S a m p l e s L o c _ T x t =27
37 Integer :: F l u i d P r o p T e x = 3 0 , F l u i d P r o p T e x _ T = 3 1 , FluidPropTex_DH = 32
38 Integer :: S a m p l e D a t a = 4 0 , SampleData_T = 4 1 , SampleData_DH = 42
39 Integer :: I n p u t P a r t = 50 , O u t p u t S c e n a r i o s = 51 , O u t p u t S c e n a r i o s 1 = 52 , O u t p u t S c e n ar i o s 2
= 5 3 , O u t p u t S c e n a r i o s 3 = 54
40
41 ! Variables regarding reading of the input f i l e s
42 Integer :: Nlines_sur
43 Character (19) , Allocatable : : DateTime_Sur ( : )
206
207
202 200 C o n t i n u e
203
204 I f ( C o u n t e r < 2 ) Then
205
206 I f ( C o u n t e r == 0 ) Then
207 L o c a t i o n = ’T ’
208 E l s e I f ( C o u n t e r == 1 ) Then
209 L o c a t i o n = ’DH’
210 End I f
211
212 S e l e c t Case ( L o c a t i o n )
213
214 Case ( ’ Den H e l d e r ’ , ’ den h e l d e r ’ , ’ dh ’ , ’DH’ , ’Dh ’ )
215 Location = ’ Den H e l d e r ’
216 W r i t e ( * , ’ (A, A) ’ ) " The l o c a t i o n i s " , t r i m ( L o c a t i o n )
217 Open ( InputCSV_Sur , f i l e = f i l e f o l d e r _ i n / / " InputData_Sur_DH_Total . csv " ) !
A l l s u r v e y d a t a , from DH, combined i n t o one f i l e .
218 Open ( SampleData , f i l e = f i l e f o l d e r _ i n / / " SampleData_DH . c s v " )
219 Open ( F l u i d P r o p T e x , f i l e = f i l e f o l d e r _ o u t / / " F u l l 0 1 − 03/
DH_FluidPropTex_Scenario_01 . t x t " )
220
221 title1 = ’ Den_Helder_Drilled_Paths ’
222
223 Case ( ’ T e x e l ’ , ’ t e x e l ’ , ’ t x l ’ , ’TXL ’ , ’ t ’ , ’T ’ )
224 Location = ’ Texel ’
225 W r i t e ( * , ’ (A, A) ’ ) " The l o c a t i o n i s " , t r i m ( L o c a t i o n )
226 Open ( InputCSV_Sur , f i l e = f i l e f o l d e r _ i n / / " InputData_Sur_Texel_Total . csv " ) !
A l l s u r v e y d a t a , from T e x e l , combined i n t o one f i l e .
227 Open ( SampleData , f i l e = f i l e f o l d e r _ i n / / " SampleData_Texel . csv " )
228 Open ( F l u i d P r o p T e x , f i l e = f i l e f o l d e r _ o u t / / " F u l l 0 1 − 03/ T _ F l u i d P r o p T e x _ S c e n a r i o _ 0 1
. txt ")
229
230 title1 = ’ Texel_Drilled_Paths ’
231
232 End S e l e c t
233
234 title0 = trim ( short ( Location ) ) // ’ Drilled Paths ’
235 title2 = trim ( short ( Location ) ) // ’ Rheologic Data ’
236 title3 = trim ( short ( Location ) ) // ’ D e n s i t y v s . Sand C o n t e n t ’
237 title4 = trim ( short ( Location ) ) // ’ T e m p e r a t u r e v s . Marsh F u n n e l ’
238
239 C a l l R e a d i n g F i l e C S V _ S u r ( InputCSV_Sur , N l i n e s _ s u r , DateTime_Sur , J o i n t , CL ,MD, I n c l i n a t i o n R a w ,
AzimuthRaw , B t o t , Dip , E l e v a t i o n C a l c , ElevationMGS , Away , R_Calc , R_MGS)
240 C a l l R e a d i n g F i l e S a m p l e D a t a ( L o c a t i o n , SampleData , No_Samples , DateTime_Samples , Sample_ID , Temp
, EC , pH , MF, Rho , SC , RPM_600 , RPM_300 , RPM_200 , RPM_100 , RPM_60 , RPM_30 , RPM_6 , RPM_3 , Gel10s ,
Gel10min )
241 C a l l R e a d i n g F i l e O u t p u t T x t ( L o c a t i o n , F l u i d P r o p T e x , Var , SampleCode , DateTimeSamples , Yield_HB ,
HB_K , HB_n , Alpha , Delta_HB , PV , YP , Delta_BH , DeltaWBH1 , DeltaWBH2 , DeltaWHB1 ,
DeltaWHB2 )
242
243
244 ! Main O p t i o n 1
245 ! −−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−
246 C a l l f2gp3D ( L o c a t i o n , Away , R_Calc , E l e v a t i o n C a l c , t i t l e 1 , ’Away [m] ’ , ’ R_{ C a l c u l a t e d } [m] ’ , ’
E l e v a t i o n [m] ’ , t i t l e 0 )
247 ! ( l o c a t i o n , x , y , z , f i l e n a m e , x− a x i s t i t l e , y− a x i s t i t l e , z − a x i s t i t l e , t i t l e )
248
249 C a l l f 2 g p R h D a t a ( L o c a t i o n , Sample_ID , RPM_600 , ’ 3 a ’ , RPM_300 , ’ 3 b ’ , RPM_200 , ’ 3 c ’ , RPM_100 , ’ 3 d ’ ,
RPM_60 , ’ 3 e ’ , RPM_30 , ’ 3 f ’ , RPM_6 , ’ 3 g ’ , RPM_3 , ’ 3 h ’ , Gel10s , ’ 3 i ’ , Gel10min , ’ 3 j ’ , t i t l e 2 , ’ S a m p l e s ’ ,
’ R e a d i n g s [ { \ 2 6 0 } ] ’ , ’RPM_{600} ’ , ’RPM_{300} ’ , ’RPM_{200} ’ , ’RPM_{100} ’ , ’RPM_{60} ’ , ’RPM_{30} ’
, ’RPM_{6} ’ , ’RPM_{3} ’ , ’ G e l 1 0 s ’ , ’ Gel10min ’ )
250 ! ( L o c a t i o n , x , y1 , y2 , y3 , y4 , y5 , y6 , y7 , y8 , t i t l e , x − a x i s t i t l e , y − a x i s t i t l e ,
graph_title1 , graph_title2 , graph_title3 , graph_title4 , graph_title5 , graph_title6 ,
graph_title7 , graph_title8 )
251
252 C a l l f 2 g p S a m p l e P a r ( L o c a t i o n , Sample_ID , Rho , ’ 3 a ’ , SC , ’ 3 b ’ , t i t l e 3 , ’ S a m p l e s ’ , ’ D e n s i t y [ kg /m^ 3 ]
’ , ’ P e r c e n t a g e [%] ’ , ’ D e n s i t y ’ , ’ Sand C o n t e n t ’ )
253
254 C a l l f 2 g p D a t a ( L o c a t i o n , ’ Y i e l d _ S t r e s s ’ , ’ Y i e l d S t r e s s ’ , ’ Sample Code ’ , ’ Y i e l d S t r e s s [ Pa ] ’ ,
SampleCode , Yield_HB , ’HB Tau Y i e l d ’ , ’ 3 a ’ ,YP , ’YP ’ , ’ 3 b ’ )
255
211
401
402 filename = ’ Drilled_Paths ’
403 title = ’ Drilled Paths ’
404 GraphOption = 3
405 C a l l f2gpwBG2 ( G r a p h O p t i o n , f i l e n a m e , SampleCode_T , SamplingAwayTot_T , S a m p l i n g D e p t h T o t _ T ,
’ 3 k ’ , Away_T , E l e v a t i o n C a l c _ T , ’ 1 a ’ , SampleCode_DH , SamplingAwayTot_DH , SamplingDepthTot_DH , ’ 3 l
’ , Away_DH , E l e v a t i o n C a l c _ D H , ’ 1 b ’ , t i t l e , ’ Sample Code ’ , ’ H e i g h t [m NAP] ’ , ’ S a m p l e s T e x e l ’ , ’
S a m p l e s Den H e l d e r ’ , ’ D r i l l e d P a t h s T e x e l ’ , ’ D r i l l e d P a t h s Den H e l d e r ’ )
406
407 filename = ’ Drilled_Paths_and_Head_Location_at_Sampling_Time ’
408 title = ’ D r i l l e d P a t h s and Head L o c a t i o n a t S a m p l i n g Time ’
409 GraphOption = 4
410 C a l l f2gpwBG2 ( G r a p h O p t i o n , f i l e n a m e , SampleCode_T , SamplingAwayTot_T , S a m p l i n g D e p t h T o t _ T ,
’ 3 k ’ , Away_T , E l e v a t i o n C a l c _ T , ’ 1 a ’ , SampleCode_DH , SamplingAwayTot_DH , SamplingDepthTot_DH , ’ 3 l
’ , Away_DH , E l e v a t i o n C a l c _ D H , ’ 1 b ’ , t i t l e , ’ Sample Code ’ , ’ H e i g h t [m NAP] ’ , ’ S a m p l e s T e x e l ’ , ’
S a m p l e s Den H e l d e r ’ , ’ D r i l l e d P a t h s T e x e l ’ , ’ D r i l l e d P a t h s Den H e l d e r ’ )
411
412 End S e l e c t
413
414 ! F i l e s f o r Hans − c o n t a i n i n g t h e l o c a t i o n o f t h e s a m p l e s i n t a b l e s
415 ! −−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−
416 Open ( 1 0 , F i l e = f i l e f o l d e r _ o u t / / " L o c a t i o n S a m p l e T i m e _ T . c s v " )
417 W r i t e ( 1 0 , ’ (A) ’ ) ’ T e x e l ’
418 W r i t e ( 1 0 , ’ ( 7 (A) ) ’ ) " Sample Code " , " ; " , "Away [m] " , " ; " , " Depth [m] " , " ; " , " R i g h t [m] "
419 Do i = 1 , s i z e ( SampleCode_T )
420 W r i t e ( 1 0 , ’ (A, 3 ( A, F7 . 2 ) ) ’ ) SampleCode_T ( i ) , " ; " , SamplingAwayTot_T ( i ) , " ; " ,
SamplingDepthTot_T ( i ) , " ; " , SamplingRightTot_T ( i )
421 End Do
422 C l o s e ( 1 0 , S t a t u s = ’KEEP ’ )
423
424 Open ( 1 0 , F i l e = f i l e f o l d e r _ o u t / / " LocationSampleTime_DH . c s v " )
425 W r i t e ( 1 0 , ’ (A) ’ ) ’ Den H e l d e r ’
426 W r i t e ( 1 0 , ’ ( 7 (A) ) ’ ) " Sample Code " , " ; " , "Away [m] " , " ; " , " Depth [m] " , " ; " , " R i g h t [m] "
427
428 Do i = 1 , s i z e ( SampleCode_DH )
429 W r i t e ( 1 0 , ’ (A, 3 ( A, F7 . 2 ) ) ’ ) SampleCode_DH ( i ) , " ; " , SamplingAwayTot_DH ( i ) , " ; " ,
SamplingDepthTot_DH ( i ) , " ; " , S a m p l i n g R i g h t T o t _ D H ( i )
430 End Do
431 C l o s e ( 1 0 , S t a t u s = ’KEEP ’ )
432 ! −−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−
433
434 ! Closing t h i s Option
435
436 Close ( OutputSamples_T )
437 C l o s e ( OutputSamples_DH )
438 Close ( OutputSamplesLoc_T_Txt )
439 C l o s e ( OutputSamplesLoc_DH_Txt )
440 C l o s e ( InputCSV_Sur_DH )
441 C l o s e ( InputCSV_Sur_T )
442
443 D e a l l o c a t e ( DateTimeSamples_T , SampleCode_T , S a m p l i n g D e p t h T o t _ T , SamplingAwayTot_T ,
S a m p l i n g R i g h t T o t _ T , S o u r c e D e p t h T o t _ T , SourceAwayTot_T , S o u r c e R i g h t T o t _ T )
444 D e a l l o c a t e ( DateTimeSamples_DH , SampleCode_DH , SamplingDepthTot_DH , SamplingAwayTot_DH ,
SamplingRightTot_DH , SourceDepthTot_DH , SourceAwayTot_DH , S o u r c e R i g h t T o t _ D H )
445 D e a l l o c a t e ( DateTime_Sur_T , J o i n t _ T , CL_T , MD_T, I n c l i n a t i o n R a w _ T , AzimuthRaw_T , Btot_T , Dip_T ,
E l e v a t i o n C a l c _ T , ElevationMGS_T , Away_T , R_Calc_T , R_MGS_T )
446 D e a l l o c a t e ( DateTime_Sur_DH , Joint_DH , CL_DH ,MD_DH, I n c l i n a t i o n R a w _ D H , AzimuthRaw_DH , Btot_DH ,
Dip_DH , E l e v a t i o n C a l c _ D H , ElevationMGS_DH , Away_DH , R_Calc_DH , R_MGS_DH)
447
448 Case ( 3 )
449
450 ! Opening , r e a d i n g and a l l o c a t i n g
451
452 W r i t e ( * , ’ (A) ’ ) " Give p r o g r a m r u n o p t i o n , ’ 1 ’ = f a s t , ’ 2 ’ = f u l l : "
453 Read ( * , ’ ( I ) ’ ) RunOption
454
455 Write ( * , * )
456 W r i t e ( * , ’ (A) ’ ) "
−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−− "
457 Write ( * , * )
458
215
524 Formation_V ( 3 3 : 3 6 ) = ’ P e e l o F o r m a t i o n DH ( PE ) ’
525 Char_PE_DH = (D ( 3 3 , : ) +D ( 3 4 , : ) +D ( 3 5 , : ) +D ( 3 6 , : ) ) / 4
526
527 Formation_V ( 3 7 ) = ’ F o r m a t i o n o f Urk DH’
528 Char_URK_DH = D( 3 7 , : )
529
530 Formation_V ( 3 8 : 4 1 ) = ’ F o r m a t i o n o f A p p e l s c h a DH ( AP ) ’
531 Char_AP_DH = (D ( 3 8 , : ) +D ( 3 9 , : ) +D ( 4 0 , : ) +D ( 4 1 , : ) ) / 4
532
533 Formation_V ( 4 2 : 4 3 ) = ’ F o r m a t i o n o f P e i z e DH ( PZ ) ’
534 Char_PZ_DH = (D ( 4 2 , : ) +D ( 4 3 , : ) ) / 2
535
536 ! Based on t h e c r o s s − s e c t i o n made b a s e d on s e i s m i c d a t a , c p t d a t a and d r i l l i n g s .
537 Formation_Sampling_Time ( 1 ) = ’Eem F o r m a t i o n , B r u i n e Bank DH ( EE−BB) ’
538 Formation_Sampling_Time ( 2 : 1 1 ) = ’ P e e l o F o r m a t i o n DH ( PE ) ’
539 Formation_Sampling_Time ( 1 2 ) = ’ F o r m a t i o n o f B o x t e l DH (BX) ’
540 Formation_Sampling_Time ( 1 3 ) = ’Eem F o r m a t i o n , B r u i n e Bank DH ( EE−BB) ’
541 Formation_Sampling_Time ( 1 4 ) = ’ P e e l o F o r m a t i o n DH ( PE ) ’
542 Formation_Sampling_Time ( 1 5 : 3 1 ) = ’ F o r m a t i o n o f A p p e l s c h a DH ( AP ) ’
543 Formation_Sampling_Time ( 3 2 : 3 3 ) = ’Eem F o r m a t i o n , B r u i n e Bank T ( EE−BB) ’
544 Formation_Sampling_Time ( 3 4 ) = ’ F o r m a t i o n o f D r e n t h e T (DR) ’
545 Formation_Sampling_Time ( 3 5 : 3 6 ) = ’ F o r m a t i o n o f Eem / Urk T ( EE−URTY) ’
546 Formation_Sampling_Time ( 3 7 : 4 7 ) = ’ F o r m a t i o n o f Urk , T y n j e T (URTY) ’
547 Formation_Sampling_Time ( 4 8 : 5 5 ) = ’ Valley F i l l ( val1_b ) ’
548 Formation_Sampling_Time ( 5 6 : 5 8 ) = ’ F o r m a t i o n o f Urk , T y n j e T (URTY) ’
549 Formation_Sampling_Time ( 5 9 : 6 9 ) = ’ P e e l o F o r m a t i o n , N i e u w o l d a T ( PENI ) ’
550
551 ! Based on g r o u p s made o f t h e s a m p l e s r e s u l t i n g from t h e s i e v e t e s t s
552 Formation_ResultGroup (12) = " Group DH 1 "
553 Formation_ResultGroup (13) = " Group DH 2 "
554 Formation_ResultGroup ( 1 : 4 ) = " Group DH 3 "
555 Formation_ResultGroup (14) = " Group DH 3 "
556 Formation_ResultGroup (5:11) = " Group DH 4 "
557 Formation_ResultGroup (15) = " Group DH 5 "
558 Formation_ResultGroup (16:19) = " Group DH 6 "
559 Formation_ResultGroup (20:31) = " Group DH 7 "
560
561 Formation_ResultGroup (32) = " Group T 1"
562 Formation_ResultGroup (33:34) = " Group T 2"
563 Formation_ResultGroup (35:36) = " Group T 3"
564 Formation_ResultGroup (37:42) = " Group T 4"
565 Formation_ResultGroup (43) = " Group To Be Done ! "
566 Formation_ResultGroup (44:46) = " Group T 5"
567 Formation_ResultGroup (47:50) = " Group T 6"
568 Formation_ResultGroup (51:55) = " Group T 7"
569 Formation_ResultGroup (56:58) = " Group T 8"
570 Formation_ResultGroup (59:64) = " Group T 9"
571 Formation_ResultGroup (65:69) = " Group T 10 "
572
573 Do i = 1 , ( s i z e (D) / 9 9 )
574 Do j = 1 , ( s i z e (D_V) / 9 9 )
575 Dev = sum ( ( D( i , : ) −D_V( j , : ) ) * * 2 )
576 DevTot ( j ) = Dev
577 ! W r i t e ( * , * ) " DevTot ( j ) = " , DevTot ( j )
578 End Do
579 ! W r i t e ( * , ’ ( A, I3 , A, I3 , A, F ) ’ ) " i , j , Min Dev = " , i , " " , m i n l o c ( DevTot ) , " " , m i n v a l ( DevTot
)
580
581 Index1 = i
582
583 A l l o c a t e ( TempArr ( 2 ) )
584 TempArr = M i n l o c ( DevTot )
585 MinValPos = TempArr ( 1 )
586 D e a l l o c a t e ( TempArr )
587
588 I f ( RunOption == 2 ) Then
589 title = ’ Most S i m i l a i r S a m p l e s ’ / / Sample_Code ( i )
590 C a l l f 2 g p S i e v e 2 ( t i t l e , ’ D i a m e t e r [mm] ’ , ’ Summation P e r c e n t a g e s by Weight [%] ’ ,
Sample_Code , D, Sample_Code_V , D_V , I n d e x 1 , ’ 1 k ’ , MinValPos , ’ 1 l ’ )
591 End I f
592
217
1048 A l l o c a t e ( V a r 1 _ S c e n a r i o 0 9 ( s i z e ( SampleCode ) ) )
1049 A l l o c a t e ( V a r 2 _ S c e n a r i o 0 9 ( s i z e ( SampleCode ) ) )
1050 A l l o c a t e ( V a r 3 _ S c e n a r i o 0 9 ( s i z e ( SampleCode ) ) )
1051 A l l o c a t e ( V a r 4 _ S c e n a r i o 0 9 ( s i z e ( SampleCode ) ) )
1052 A l l o c a t e ( V a r 5 _ S c e n a r i o 0 9 ( s i z e ( SampleCode ) ) )
1053 A l l o c a t e ( V a r 6 _ S c e n a r i o 0 9 ( s i z e ( SampleCode ) ) )
1054 I f ( A l l o c a t e d ( Var7 ) ) A l l o c a t e ( V a r 7 _ S c e n a r i o 0 9 ( s i z e ( SampleCode ) ) )
1055 I f ( A l l o c a t e d ( Var8 ) ) A l l o c a t e ( V a r 8 _ S c e n a r i o 0 9 ( s i z e ( SampleCode ) ) )
1056 I f ( A l l o c a t e d ( Var9 ) ) A l l o c a t e ( V a r 9 _ S c e n a r i o 0 9 ( s i z e ( SampleCode ) ) )
1057 I f ( A l l o c a t e d ( Var10 ) ) A l l o c a t e ( V a r 1 0 _ S c e n a r i o 0 9 ( s i z e ( SampleCode ) ) )
1058 I f ( A l l o c a t e d ( Var11 ) ) A l l o c a t e ( V a r 1 1 _ S c e n a r i o 0 9 ( s i z e ( SampleCode ) ) )
1059 I f ( A l l o c a t e d ( Var12 ) ) A l l o c a t e ( V a r 1 2 _ S c e n a r i o 0 9 ( s i z e ( SampleCode ) ) )
1060 I f ( A l l o c a t e d ( Var13 ) ) A l l o c a t e ( V a r 1 3 _ S c e n a r i o 0 9 ( s i z e ( SampleCode ) ) )
1061 I f ( A l l o c a t e d ( Var14 ) ) A l l o c a t e ( V a r 1 4 _ S c e n a r i o 0 9 ( s i z e ( SampleCode ) ) )
1062 I f ( A l l o c a t e d ( Var15 ) ) A l l o c a t e ( V a r 1 5 _ S c e n a r i o 0 9 ( s i z e ( SampleCode ) ) )
1063 I f ( A l l o c a t e d ( Var16 ) ) A l l o c a t e ( V a r 1 6 _ S c e n a r i o 0 9 ( s i z e ( SampleCode ) ) )
1064 I f ( A l l o c a t e d ( Var17 ) ) A l l o c a t e ( V a r 1 7 _ S c e n a r i o 0 9 ( s i z e ( SampleCode ) ) )
1065 I f ( A l l o c a t e d ( Var18 ) ) A l l o c a t e ( V a r 1 8 _ S c e n a r i o 0 9 ( s i z e ( SampleCode ) ) )
1066
1067 Var1_Scenario09 = Var1
1068 Var2_Scenario09 = Var2
1069 Var3_Scenario09 = Var3
1070 Var4_Scenario09 = Var4
1071 Var5_Scenario09 = Var5
1072 Var6_Scenario09 = Var6
1073 I f ( A l l o c a t e d ( Var7 ) ) Var7_Scenario09 = Var7
1074 I f ( A l l o c a t e d ( Var8 ) ) Var8_Scenario09 = Var8
1075 I f ( A l l o c a t e d ( Var9 ) ) Var9_Scenario09 = Var9
1076 I f ( A l l o c a t e d ( Var10 ) ) Var10_Scenario09 = Var10
1077 I f ( A l l o c a t e d ( Var11 ) ) Var11_Scenario09 = Var11
1078 I f ( A l l o c a t e d ( Var12 ) ) Var12_Scenario09 = Var12
1079 I f ( A l l o c a t e d ( Var13 ) ) Var13_Scenario09 = Var13
1080 I f ( A l l o c a t e d ( Var14 ) ) Var14_Scenario09 = Var14
1081 I f ( A l l o c a t e d ( Var15 ) ) Var15_Scenario09 = Var15
1082 I f ( A l l o c a t e d ( Var16 ) ) Var16_Scenario09 = Var16
1083 I f ( A l l o c a t e d ( Var17 ) ) Var17_Scenario09 = Var17
1084 I f ( A l l o c a t e d ( Var18 ) ) Var18_Scenario09 = Var18
1085
1086 End I f
1087
1088 Close ( I n p u t p a r t )
1089 D e a l l o c a t e ( SampleCode , DateTimeSamples , Var , Var1 , Var2 , Var3 , Var4 , Var5 , Var6 )
1090 I f ( A l l o c a t e d ( Var7 ) ) D e a l l o c a t e ( Var7 )
1091 I f ( A l l o c a t e d ( Var8 ) ) D e a l l o c a t e ( Var8 )
1092 I f ( A l l o c a t e d ( Var9 ) ) D e a l l o c a t e ( Var9 )
1093 I f ( A l l o c a t e d ( Var10 ) ) D e a l l o c a t e ( Var10 )
1094 I f ( A l l o c a t e d ( Var11 ) ) D e a l l o c a t e ( Var11 )
1095 I f ( A l l o c a t e d ( Var12 ) ) D e a l l o c a t e ( Var12 )
1096 I f ( A l l o c a t e d ( Var13 ) ) D e a l l o c a t e ( Var13 )
1097 I f ( A l l o c a t e d ( Var14 ) ) D e a l l o c a t e ( Var14 )
1098 I f ( A l l o c a t e d ( Var15 ) ) D e a l l o c a t e ( Var15 )
1099 I f ( A l l o c a t e d ( Var16 ) ) D e a l l o c a t e ( Var16 )
1100 I f ( A l l o c a t e d ( Var17 ) ) D e a l l o c a t e ( Var17 )
1101 I f ( A l l o c a t e d ( Var18 ) ) D e a l l o c a t e ( Var18 )
1102
1103 End Do
1104
1105 ! Writing Files
1106
1107 Open ( I n p u t p a r t , f i l e = f i l e f o l d e r _ o u t / / trim ( Filename ) )
1108
1109 I f ( k == 1 ) Then
1110 C a l l R e a d i n g F i l e O u t p u t T x t ( L o c a t i o n , I n p u t P a r t , Var , SampleCode , DateTimeSamples , Var1 ,
Var2 , Var3 , Var4 , Var5 , Var6 )
1111 E l s e I f ( k == 2 ) Then
1112 C a l l R e a d i n g F i l e O u t p u t T x t ( L o c a t i o n , I n p u t P a r t , Var , SampleCode , DateTimeSamples , Var1 ,
Var2 , Var3 , Var4 , Var5 , Var6 , Var7 , Var8 , Var9 , Var10 , Var11 , Var12 , Var13 , Var14 , Var15 , Var16 , Var17 ,
Var18 )
1113 End I f
1114
1115 Close ( I n p u t p a r t )
225
1116
1117 I f ( k == 1 ) Then
1118
1119 W r i t e ( F i l e n a m e _ O u t , ’ ( 2 (A) ) ’ ) trim ( Short ( trim ( Location ) ) ) , " _Locations_Scenarios .
csv "
1120 Open ( O u t p u t S c e n a r i o s , f i l e = f i l e f o l d e r _ o u t / / Filename_Out )
1121
1122 W r i t e ( O u t p u t S c e n a r i o s , ’ (A, 2 7 ( A, A, A) ) ’ ) t r i m ( Var ( 1 ) ) , " ; " , t r i m ( Var ( 6 ) ) , "
S c e n a r i o 1 " , " ; " , t r i m ( Var ( 6 ) ) , " S c e n a r i o 2 " , " ; " , t r i m ( Var ( 6 ) ) , " S c e n a r i o 3 " , " ; " , t r i m (
Var ( 6 ) ) , " S c e n a r i o 4 " , " ; " , t r i m ( Var ( 6 ) ) , " S c e n a r i o 5 " , " ; " , t r i m ( Var ( 6 ) ) , " S c e n a r i o 6 " , "
; " , t r i m ( Var ( 6 ) ) , " S c e n a r i o 7 " , " ; " , t r i m ( Var ( 6 ) ) , " S c e n a r i o 8 " , " ; " , t r i m ( Var ( 6 ) ) , "
S c e n a r i o 9 " , " ; " , t r i m ( Var ( 7 ) ) , " S c e n a r i o 1 " , " ; " , t r i m ( Var ( 7 ) ) , " S c e n a r i o 2 " , " ; " , t r i m (
Var ( 7 ) ) , " S c e n a r i o 3 " , " ; " , t r i m ( Var ( 7 ) ) , " S c e n a r i o 4 " , " ; " , t r i m ( Var ( 7 ) ) , " S c e n a r i o 5 " , "
; " , t r i m ( Var ( 7 ) ) , " S c e n a r i o 6 " , " ; " , t r i m ( Var ( 7 ) ) , " S c e n a r i o 7 " , " ; " , t r i m ( Var ( 7 ) ) , "
S c e n a r i o 8 " , " ; " , t r i m ( Var ( 7 ) ) , " S c e n a r i o 9 " , " ; " , t r i m ( Var ( 8 ) ) , " S c e n a r i o 1 " , " ; " , t r i m (
Var ( 8 ) ) , " S c e n a r i o 2 " , " ; " , t r i m ( Var ( 8 ) ) , " S c e n a r i o 3 " , " ; " , t r i m ( Var ( 8 ) ) , " S c e n a r i o 4 " , "
; " , t r i m ( Var ( 8 ) ) , " S c e n a r i o 5 " , " ; " , t r i m ( Var ( 8 ) ) , " S c e n a r i o 6 " , " ; " , t r i m ( Var ( 8 ) ) , "
S c e n a r i o 7 " , " ; " , t r i m ( Var ( 8 ) ) , " S c e n a r i o 8 " , " ; " , t r i m ( Var ( 8 ) ) , " S c e n a r i o 9 "
1123
1124 Do i =1 , s i z e ( SampleCode )
1125 W r i t e ( O u t p u t S c e n a r i o s , ’ (A, 2 7 ( A, F ) ) ’ ) SampleCode ( i ) , " ; " , V a r 4 _ S c e n a r i o 0 1 ( i ) , " ; "
, Var4_Scenario02 ( i ) , " ; " , Var4_Scenario03 ( i ) , " ; " , Var4_Scenario04 ( i ) , " ; " , Var4_Scenario05 ( i ) ,
" ; " , Var4_Scenario06 ( i ) , " ; " , Var4_Scenario07 ( i ) , " ; " , Var4_Scenario08 ( i ) , " ; " , Var4_Scenario09 (
i ) , " ; " , Var5_Scenario01 ( i ) , " ; " , Var5_Scenario02 ( i ) , " ; " , Var5_Scenario03 ( i ) , " ; " ,
Var5_Scenario04 ( i ) , " ; " , Var5_Scenario05 ( i ) , " ; " , Var5_Scenario06 ( i ) , " ; " , Var5_Scenario07 ( i ) , "
; " , Var5_Scenario08 ( i ) , " ; " , Var5_Scenario09 ( i ) , " ; " , Var6_Scenario01 ( i ) , " ; " , Var6_Scenario02 ( i
) , " ; " , Var6_Scenario03 ( i ) , " ; " , Var6_Scenario04 ( i ) , " ; " , Var6_Scenario05 ( i ) , " ; " ,
Var6_Scenario06 ( i ) , " ; " , Var6_Scenario07 ( i ) , " ; " , Var6_Scenario08 ( i ) , " ; " , Var6_Scenario09 ( i )
1126 End Do
1127
1128 E l s e I f ( k == 2 ) Then
1129
1130 W r i t e ( F i l e n a m e _ O u t , ’ ( 2 (A) ) ’ ) trim ( Short ( trim ( Location ) ) ) , " _Transport_1_Scenarios
. csv "
1131 Open ( O u t p u t S c e n a r i o s 1 , f i l e = f i l e f o l d e r _ o u t / / Filename_Out )
1132
1133 W r i t e ( O u t p u t S c e n a r i o s 1 , ’ (A, 2 7 ( A, A, A) ) ’ ) t r i m ( Var ( 1 ) ) , " ; " , t r i m ( Var ( 4 ) ) , "
S c e n a r i o 1 " , " ; " , t r i m ( Var ( 4 ) ) , " S c e n a r i o 2 " , " ; " , t r i m ( Var ( 4 ) ) , " S c e n a r i o 3 " , " ; " , t r i m (
Var ( 4 ) ) , " S c e n a r i o 4 " , " ; " , t r i m ( Var ( 4 ) ) , " S c e n a r i o 5 " , " ; " , t r i m ( Var ( 4 ) ) , " S c e n a r i o 6 " , "
; " , t r i m ( Var ( 4 ) ) , " S c e n a r i o 7 " , " ; " , t r i m ( Var ( 4 ) ) , " S c e n a r i o 8 " , " ; " , t r i m ( Var ( 4 ) ) , "
S c e n a r i o 9 " , " ; " , t r i m ( Var ( 9 ) ) , " S c e n a r i o 1 " , " ; " , t r i m ( Var ( 9 ) ) , " S c e n a r i o 2 " , " ; " , t r i m (
Var ( 9 ) ) , " S c e n a r i o 3 " , " ; " , t r i m ( Var ( 9 ) ) , " S c e n a r i o 4 " , " ; " , t r i m ( Var ( 9 ) ) , " S c e n a r i o 5 " , "
; " , t r i m ( Var ( 9 ) ) , " S c e n a r i o 6 " , " ; " , t r i m ( Var ( 9 ) ) , " S c e n a r i o 7 " , " ; " , t r i m ( Var ( 9 ) ) , "
S c e n a r i o 8 " , " ; " , t r i m ( Var ( 9 ) ) , " S c e n a r i o 9 " , " ; " , t r i m ( Var ( 1 0 ) ) , " S c e n a r i o 1 " , " ; " , t r i m
( Var ( 1 0 ) ) , " S c e n a r i o 2 " , " ; " , t r i m ( Var ( 1 0 ) ) , " S c e n a r i o 3 " , " ; " , t r i m ( Var ( 1 0 ) ) , " S c e n a r i o
4 " , " ; " , t r i m ( Var ( 1 0 ) ) , " S c e n a r i o 5 " , " ; " , t r i m ( Var ( 1 0 ) ) , " S c e n a r i o 6 " , " ; " , t r i m ( Var ( 1 0 )
) , " S c e n a r i o 7 " , " ; " , t r i m ( Var ( 1 0 ) ) , " S c e n a r i o 8 " , " ; " , t r i m ( Var ( 1 0 ) ) , " S c e n a r i o 9 "
1134
1135 Do i =1 , s i z e ( SampleCode )
1136 W r i t e ( O u t p u t S c e n a r i o s 1 , ’ (A, 2 7 ( A, F ) ) ’ ) SampleCode ( i ) , " ; " , V a r 2 _ S c e n a r i o 0 1 ( i ) , " ;
" , Var2_Scenario02 ( i ) , " ; " , Var2_Scenario03 ( i ) , " ; " , Var2_Scenario04 ( i ) , " ; " , Var2_Scenario05 ( i )
, " ; " , Var2_Scenario06 ( i ) , " ; " , Var2_Scenario07 ( i ) , " ; " , Var2_Scenario08 ( i ) , " ; " , Var2_Scenario09
( i ) , " ; " , Var7_Scenario01 ( i ) , " ; " , Var7_Scenario02 ( i ) , " ; " , Var7_Scenario03 ( i ) , " ; " ,
Var7_Scenario04 ( i ) , " ; " , Var7_Scenario05 ( i ) , " ; " , Var7_Scenario06 ( i ) , " ; " , Var7_Scenario07 ( i ) , "
; " , Var7_Scenario08 ( i ) , " ; " , Var7_Scenario09 ( i ) , " ; " , Var8_Scenario01 ( i ) , " ; " , Var8_Scenario02 ( i
) , " ; " , Var8_Scenario03 ( i ) , " ; " , Var8_Scenario04 ( i ) , " ; " , Var8_Scenario05 ( i ) , " ; " ,
Var8_Scenario06 ( i ) , " ; " , Var8_Scenario07 ( i ) , " ; " , Var8_Scenario08 ( i ) , " ; " , Var8_Scenario09 ( i )
1137 End Do
1138
1139 Write ( OutputScenarios1 , * )
1140 W r i t e ( O u t p u t S c e n a r i o s 1 , ’ (A, 2 7 ( A, F ) ) ’ ) " Averages , e x c l u d i n g 0 : " , " ; " , Average (
Var2_Scenario01 ) , " ; " , Average ( Var2_Scenario02 ) , " ; " , Average ( Var2_Scenario03 ) , " ; " , Average (
Var2_Scenario04 ) , " ; " , Average ( Var2_Scenario05 ) , " ; " , Average ( Var2_Scenario06 ) , " ; " , Average (
Var2_Scenario07 ) , " ; " , Average ( Var2_Scenario08 ) , " ; " , Average ( Var2_Scenario09 ) , " ; " , Average (
Var7_Scenario01 ) , " ; " , Average ( Var7_Scenario02 ) , " ; " , Average ( Var7_Scenario03 ) , " ; " , Average (
Var7_Scenario04 ) , " ; " , Average ( Var7_Scenario05 ) , " ; " , Average ( Var7_Scenario06 ) , " ; " , Average (
Var7_Scenario07 ) , " ; " , Average ( Var7_Scenario08 ) , " ; " , Average ( Var7_Scenario09 ) , " ; " , Average (
Var8_Scenario01 ) , " ; " , Average ( Var8_Scenario02 ) , " ; " , Average ( Var8_Scenario03 ) , " ; " , Average (
Var8_Scenario04 ) , " ; " , Average ( Var8_Scenario05 ) , " ; " , Average ( Var8_Scenario06 ) , " ; " , Average (
Var8_Scenario07 ) , " ; " , Average ( Var8_Scenario08 ) , " ; " , Average ( Var8_Scenario09 )
1141
226 F. Code of the MarsdiepVisual Program
Average ( Var15_Scenario06 ) , " ; " , Average ( Var15_Scenario07 ) , " ; " , Average ( Var15_Scenario08 ) , " ; "
, Average ( Var15_Scenario09 ) , " ; " , Average ( Var16_Scenario01 ) , " ; " , Average ( Var16_Scenario02 ) , " ;
" , Average ( Var16_Scenario03 ) , " ; " , Average ( Var16_Scenario04 ) , " ; " , Average ( Var16_Scenario05 ) , "
; " , Average ( Var16_Scenario06 ) , " ; " , Average ( Var16_Scenario07 ) , " ; " , Average ( Var16_Scenario08 ) ,
" ; " , Average ( Var16_Scenario09 ) , " ; " , Average ( Var17_Scenario01 ) , " ; " , Average ( Var17_Scenario02 )
, " ; " , Average ( Var17_Scenario03 ) , " ; " , Average ( Var17_Scenario04 ) , " ; " , Average ( Var17_Scenario05
) , " ; " , Average ( Var17_Scenario06 ) , " ; " , Average ( Var17_Scenario07 ) , " ; " , Average (
Var17_Scenario08 ) , " ; " , Average ( Var17_Scenario09 ) , " ; " , Average ( Var18_Scenario01 ) , " ; " , Average
( Var18_Scenario02 ) , " ; " , Average ( Var18_Scenario03 ) , " ; " , Average ( Var18_Scenario04 ) , " ; " ,
Average ( Var18_Scenario05 ) , " ; " , Average ( Var18_Scenario06 ) , " ; " , Average ( Var18_Scenario07 ) , " ; "
, Average ( Var18_Scenario08 ) , " ; " , Average ( Var18_Scenario09 )
1165
1166 End I f
1167
1168 ! C l o s i n g and D e a l l o c a t i n g
1169
1170 Close ( OutputScenarios )
1171 Close ( OutputScenarios1 )
1172 Close ( OutputScenarios2 )
1173 Close ( OutputScenarios3 )
1174
1175 D e a l l o c a t e ( SampleCode , DateTimeSamples , Var , Var1 , Var2 , Var3 , Var4 , Var5 , Var6 )
1176
1177 If ( A l l o c a t e d ( Var7 ) ) D e a l l o c a t e ( Var7 )
1178 If ( A l l o c a t e d ( Var8 ) ) D e a l l o c a t e ( Var8 )
1179 If ( A l l o c a t e d ( Var9 ) ) D e a l l o c a t e ( Var9 )
1180 If ( A l l o c a t e d ( Var10 ) ) D e a l l o c a t e ( Var10 )
1181 If ( A l l o c a t e d ( Var11 ) ) D e a l l o c a t e ( Var11 )
1182 If ( A l l o c a t e d ( Var12 ) ) D e a l l o c a t e ( Var12 )
1183 If ( A l l o c a t e d ( Var13 ) ) D e a l l o c a t e ( Var13 )
1184 If ( A l l o c a t e d ( Var14 ) ) D e a l l o c a t e ( Var14 )
1185 If ( A l l o c a t e d ( Var15 ) ) D e a l l o c a t e ( Var15 )
1186 If ( A l l o c a t e d ( Var16 ) ) D e a l l o c a t e ( Var16 )
1187 If ( A l l o c a t e d ( Var17 ) ) D e a l l o c a t e ( Var17 )
1188 If ( A l l o c a t e d ( Var18 ) ) D e a l l o c a t e ( Var18 )
1189
1190 D e a l l o c a t e ( Var1_Scenario01 , Var1_Scenario02 , Var1_Scenario03 , Var1_Scenario04 ,
Var1_Scenario05 , Var1_Scenario06 , Var1_Scenario07 , Var1_Scenario08 , Var1_Scenario09 )
1191 D e a l l o c a t e ( Var2_Scenario01 , Var2_Scenario02 , Var2_Scenario03 , Var2_Scenario04 ,
Var2_Scenario05 , Var2_Scenario06 , Var2_Scenario07 , Var2_Scenario08 , Var2_Scenario09 )
1192 D e a l l o c a t e ( Var3_Scenario01 , Var3_Scenario02 , Var3_Scenario03 , Var3_Scenario04 ,
Var3_Scenario05 , Var3_Scenario06 , Var3_Scenario07 , Var3_Scenario08 , Var3_Scenario09 )
1193 D e a l l o c a t e ( Var4_Scenario01 , Var4_Scenario02 , Var4_Scenario03 , Var4_Scenario04 ,
Var4_Scenario05 , Var4_Scenario06 , Var4_Scenario07 , Var4_Scenario08 , Var4_Scenario09 )
1194 D e a l l o c a t e ( Var5_Scenario01 , Var5_Scenario02 , Var5_Scenario03 , Var5_Scenario04 ,
Var5_Scenario05 , Var5_Scenario06 , Var5_Scenario07 , Var5_Scenario08 , Var5_Scenario09 )
1195 D e a l l o c a t e ( Var6_Scenario01 , Var6_Scenario02 , Var6_Scenario03 , Var6_Scenario04 ,
Var6_Scenario05 , Var6_Scenario06 , Var6_Scenario07 , Var6_Scenario08 , Var6_Scenario09 )
1196
1197 I f ( A l l o c a t e d ( Var7 ) ) D e a l l o c a t e ( Var7_Scenario01 , Var7_Scenario02 , Var7_Scenario03 ,
Var7_Scenario04 , Var7_Scenario05 , Var7_Scenario06 , Var7_Scenario07 , Var7_Scenario08 ,
Var7_Scenario09 )
1198 I f ( A l l o c a t e d ( Var8 ) ) D e a l l o c a t e ( Var8_Scenario01 , Var8_Scenario02 , Var8_Scenario03 ,
Var8_Scenario04 , Var8_Scenario05 , Var8_Scenario06 , Var8_Scenario07 , Var8_Scenario08 ,
Var8_Scenario09 )
1199 I f ( A l l o c a t e d ( Var9 ) ) D e a l l o c a t e ( Var9_Scenario01 , Var9_Scenario02 , Var9_Scenario03 ,
Var9_Scenario04 , Var9_Scenario05 , Var9_Scenario06 , Var9_Scenario07 , Var9_Scenario08 ,
Var9_Scenario09 )
1200 I f ( A l l o c a t e d ( Var10 ) ) D e a l l o c a t e ( Var10_Scenario01 , Var10_Scenario02 ,
Var10_Scenario03 , Var10_Scenario04 , Var10_Scenario05 , Var10_Scenario06 , Var10_Scenario07 ,
Var10_Scenario08 , Var10_Scenario09 )
1201 I f ( A l l o c a t e d ( Var11 ) ) D e a l l o c a t e ( Var11_Scenario01 , Var11_Scenario02 ,
Var11_Scenario03 , Var11_Scenario04 , Var11_Scenario05 , Var11_Scenario06 , Var11_Scenario07 ,
Var11_Scenario08 , Var11_Scenario09 )
1202 I f ( A l l o c a t e d ( Var12 ) ) D e a l l o c a t e ( Var12_Scenario01 , Var12_Scenario02 ,
Var12_Scenario03 , Var12_Scenario04 , Var12_Scenario05 , Var12_Scenario06 , Var12_Scenario07 ,
Var12_Scenario08 , Var12_Scenario09 )
1203 I f ( A l l o c a t e d ( Var13 ) ) D e a l l o c a t e ( Var13_Scenario01 , Var13_Scenario02 ,
Var13_Scenario03 , Var13_Scenario04 , Var13_Scenario05 , Var13_Scenario06 , Var13_Scenario07 ,
Var13_Scenario08 , Var13_Scenario09 )
1204 I f ( A l l o c a t e d ( Var14 ) ) D e a l l o c a t e ( Var14_Scenario01 , Var14_Scenario02 ,
228 F. Code of the MarsdiepVisual Program
1259 Do j =1 ,8
1260 Close (100+ j )
1261 End Do
1262
1263 BackgroundName = ’ C r o s s s e c t i o n ’ ! . png t y p e i s r e q u i r e d , o r i g i n a l c r o s s − s e c t i o n
1264 W r i t e ( t i t l e , ’ (A, I 2 . 2 ) ’ ) " F o r m a t i o n s S c e n a r i o " , S c e n a r i o N o
1265 C a l l f2gpwBGFm ( S c e n a r i o N o , BackgroundName , t r i m ( t i t l e ) , ’ Sample Code ’ , ’ H e i g h t [m NAP] ’ ,
F i l e N a m e s ( 1 ) , ’ B o x t e l Fm ’ , ’ 4 a ’ , F i l e N a m e s ( 2 ) , ’ K r e f t e n h e y e Fm ’ , ’ 4 b ’ , F i l e N a m e s ( 3 ) , ’Eem Fm ’ , ’ 4
c ’ , F i l e N a m e s ( 4 ) , ’URTY ’ , ’ 4 d ’ , F i l e N a m e s ( 5 ) , ’ P e e l o Fm ’ , ’ 4 e ’ , F i l e N a m e s ( 6 ) , ’URVE ’ , ’ 4 f ’ ,
F i l e N a m e s ( 7 ) , ’ A p p e l s c h a Fm ’ , ’ 4 g ’ , F i l e N a m e s ( 8 ) , ’ A p p e l s c h a W e e r d i n g h e ’ , ’ 4 h ’ )
1266
1267 BackgroundName = ’ C r o s s S e c t i o n B l a n c o ’ ! . png t y p e i s r e q u i r e d , f a c t map
1268 W r i t e ( t i t l e , ’ (A, I 2 . 2 ) ’ ) " F o r m a t i o n s S c e n a r i o " , S c e n a r i o N o
1269 C a l l f2gpwBGFm ( S c e n a r i o N o , BackgroundName , t r i m ( t i t l e ) , ’ Sample Code ’ , ’ H e i g h t [m NAP] ’ ,
F i l e N a m e s ( 1 ) , ’ B o x t e l Fm ’ , ’ 4 a ’ , F i l e N a m e s ( 2 ) , ’ K r e f t e n h e y e Fm ’ , ’ 4 b ’ , F i l e N a m e s ( 3 ) , ’Eem Fm ’ , ’ 4
c ’ , F i l e N a m e s ( 4 ) , ’URTY ’ , ’ 4 d ’ , F i l e N a m e s ( 5 ) , ’ P e e l o Fm ’ , ’ 4 e ’ , F i l e N a m e s ( 6 ) , ’URVE ’ , ’ 4 f ’ ,
F i l e N a m e s ( 7 ) , ’ A p p e l s c h a Fm ’ , ’ 4 g ’ , F i l e N a m e s ( 8 ) , ’ A p p e l s c h a W e e r d i n g h e ’ , ’ 4 h ’ )
1270
1271 BackgroundName = ’ C r o s s S e c t i o n V 2 ’ ! . png t y p e i s r e q u i r e d , p r o p o s a l V2
1272 W r i t e ( t i t l e , ’ (A, I 2 . 2 ) ’ ) " F o r m a t i o n s S c e n a r i o " , S c e n a r i o N o
1273 C a l l f2gpwBGFm ( S c e n a r i o N o , BackgroundName , t r i m ( t i t l e ) , ’ Sample Code ’ , ’ H e i g h t [m NAP] ’ ,
F i l e N a m e s ( 1 ) , ’ B o x t e l Fm ’ , ’ 4 a ’ , F i l e N a m e s ( 2 ) , ’ K r e f t e n h e y e Fm ’ , ’ 4 b ’ , F i l e N a m e s ( 3 ) , ’Eem Fm ’ , ’ 4
c ’ , F i l e N a m e s ( 4 ) , ’URTY ’ , ’ 4 d ’ , F i l e N a m e s ( 5 ) , ’ P e e l o Fm ’ , ’ 4 e ’ , F i l e N a m e s ( 6 ) , ’URVE ’ , ’ 4 f ’ ,
F i l e N a m e s ( 7 ) , ’ A p p e l s c h a Fm ’ , ’ 4 g ’ , F i l e N a m e s ( 8 ) , ’ A p p e l s c h a W e e r d i n g h e ’ , ’ 4 h ’ )
1274
1275 BackgroundName = ’ C r o s s S e c t i o n V 3 ’ ! . png t y p e i s r e q u i r e d , p r o p o s a l V3
1276 W r i t e ( t i t l e , ’ (A, I 2 . 2 ) ’ ) " F o r m a t i o n s S c e n a r i o " , S c e n a r i o N o
1277 C a l l f2gpwBGFm ( S c e n a r i o N o , BackgroundName , t r i m ( t i t l e ) , ’ Sample Code ’ , ’ H e i g h t [m NAP] ’ ,
F i l e N a m e s ( 1 ) , ’ B o x t e l Fm ’ , ’ 4 a ’ , F i l e N a m e s ( 2 ) , ’ K r e f t e n h e y e Fm ’ , ’ 4 b ’ , F i l e N a m e s ( 3 ) , ’Eem Fm ’ , ’ 4
c ’ , F i l e N a m e s ( 4 ) , ’URTY ’ , ’ 4 d ’ , F i l e N a m e s ( 5 ) , ’ P e e l o Fm ’ , ’ 4 e ’ , F i l e N a m e s ( 6 ) , ’URVE ’ , ’ 4 f ’ ,
F i l e N a m e s ( 7 ) , ’ A p p e l s c h a Fm ’ , ’ 4 g ’ , F i l e N a m e s ( 8 ) , ’ A p p e l s c h a W e e r d i n g h e ’ , ’ 4 h ’ )
1278
1279 Do j =1 ,8
1280 W r i t e ( F i l e N a m e s ( j ) , ’ (A, I 2 . 2 ,A) ’ ) " Data_Fm " , j , " . d a t "
1281 Command = ’ d e l ’ / / t r i m ( F i l e n a m e s ( j ) )
1282 C a l l SYSTEM( t r i m ( Command ) )
1283 End Do
1284
1285 Deallocate ( Filenames )
1286 D e a l l o c a t e ( SampleCode_T , DateTimeSamples_T , SamplingAwayTot_T , S a m p l i n g D e p t h T o t _ T ,
S a m p l i n g R i g h t T o t _ T , SourceAwayTot_T , S o u r c e D e p t h T o t _ T , S o u r c e R i g h t T o t _ T )
1287 D e a l l o c a t e ( SampleCode_DH , DateTimeSamples_DH , SamplingAwayTot_DH , SamplingDepthTot_DH ,
SamplingRightTot_DH , SourceAwayTot_DH , SourceDepthTot_DH , S o u r c e R i g h t T o t _ D H )
1288
1289 Close ( OutputSamplesLoc_T_Txt )
1290 C l o s e ( OutputSamplesLoc_DH_Txt )
1291
1292 End Do
1293
1294 C l o s e ( FormationsTNO )
1295 D e a l l o c a t e ( Sample_Code , Fm_No , Fm)
1296
1297 Case D e f a u l t
1298
1299 W r i t e ( * , ’ (A) ’ ) " Unknown O p t i o n , p r o g r a m i s t e r m i n a t e d . "
1300 Read ( * , * )
1301 Stop
1302
1303 End S e l e c t
1304
1305 ! −−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−
1306
1307 Write ( * , * )
1308 W r i t e ( * , ’ (A) ’ ) "
−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−− "
1309 W r i t e ( * , ’ (A) ’ ) " The c h o s e n p a r t o f t h e p r o g r a m i s done , t o go b a c k t o t h e s t a r t t y p e ’ 1 ’ o r
t y p e ’0 ’ t o c l o s e t h e program : "
1310 Read ( * , * ) EndOption
1311
1312 S e l e c t Case ( E n d O p t i o n )
1313
230 F. Code of the MarsdiepVisual Program
1314 Case ( 0 )
1315
1316 Stop
1317
1318 Case ( 1 )
1319
1320 Write ( * , * )
1321 W r i t e ( * , ’ (A) ’ ) "
−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−− "
1322 Write ( * , * )
1323 Go t o 100
1324
1325 Case D e f a u l t
1326
1327 W r i t e ( * , ’ (A) ’ ) " Unknown o p t i o n p r o g r a m i s t e r m i n a t e d . "
1328 Read ( * , * )
1329 Stop
1330
1331 End S e l e c t
1332
1333 ! −−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−
1334
1335 End Program M a r s d i e p V i s u a l
Code/MarsdiepVisual.f90
1 Module V i s u a l M o d u l e
2
3 I m p l i c i t None
4
5 Contains
6
7 ! −−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−
8 ! FUNCTIONS
9 ! −−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−
10
11 I n t e g e r Function LineCount ( F i l e )
12 ! C a l c u l a t e s t h e amount o f l i n e s i n a f i l e
13 ! Based on h t t p : / / web . u t a h . edu / t h o r n e / c o m p u t i n g / H a n d y _ F o r t r a n _ T r i c k s . pdf , b o t t o m l a s t p a g e
14 ! See h t t p : / / s t a c k o v e r f l o w . com / q u e s t i o n s / 1 9 7 1 3 2 0 7 / u s i n g −do − l o o p − i n −a − f o r t r a n 9 0 − program − t o −
r e a d − d i f f e r e n t − number − of − l i n e s − f o r −n − f r a f o r how t o c h a n g e t o column c o u n t .
15 I m p l i c i t None
16
17 Integer :: File , nlines
18 Integer :: io
19
20 nlines = 0 ! Number o f l i n e s n e e d s a s t a r t v a l u e
21
22 Do
23 Read ( F i l e , * , IOSTAT= i o )
24 I f ( i o > 0 ) Then
25 W r i t e ( * , * ) " Check i n p u t . S o m e t h i n g i s wrong . . . "
26 Exit
27 E l s e I f ( i o < 0 ) Then ! I o s t a t i s n e g a t i v e f o r end o f f i l e .
28 ! WRITE ( * , * ) " End o f f i l e i s r e a c h e d . " ! No l o n g e r n e c e s s a r y o n c e i t works .
29 Exit
30 Else
31 n l i n e s = n l i n e s +1
32 End I f
33 End Do
34
35 Rewind ( F i l e ) ! Reading of t h e d a t a s t a r t s a t t h e top of t h e f i l e again .
36
37 Linecount = nlines
38
39 End F u n c t i o n
40
41 ! −−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−
42
43 I n t e g e r F u n c t i o n ColumnCount ( F i l e , S e p a r a t o r )
231
44 ! C o u n t s t h e number o f c o l u m n s i n a f i l e by c o u n t i n g t h e s e p a r a t o r s .
45 ! Assumed i s t h a t t h e f i l e h a s t h e same number o f c o l u m n s f o r e v e r y l i n e and t h a t t h e l i n e s
a r e s e p a r a t e d by a symbol which i s n o t e q u a l t o t h e d e c i m a l o r t h o u s a n d s i g n and n o t
e q u a l t o t h e symbol f o r empty s p a c e s i f t h o s a a r e p r e s e n t .
46 ! Based on h t t p : / / r o s e t t a c o d e . o r g / w i k i / C o u n t _ o c c u r r e n c e s _ o f _ a _ s u b s t r i n g # F o r t r a n
47 I m p l i c i t None
48
49 Integer :: File
50 Integer :: nSeparators
51 Character (*) :: Separator
52 Character (2048) :: Line
53 Integer :: Pos , posmin
54
55 Read ( F i l e , ’ (A) ’ ) L i n e
56
57 nSeparators = 0
58 Posmin = 1
59
60 Do ! I n f i n i t e loop , loop r u n s t i l l t h e command i s r e a c h e d t h a t c l o s e s i t .
61 Pos = I n d e x ( L i n e ( posmin : ) , S e p a r a t o r )
62
63 I f ( Pos == 0 ) Then ! EOF i s r e a c h e d , i n d e x r e t u r n s 0 i f s u b s t r i n g i s n o t f o u n d .
64 ColumnCount = nSeparators + 1 ! nColumns i s a c t u a l l y t h e number o f s e p a r a t o r s .
65 Rewind ( F i l e ) ! Reading of t h e d a t a s t a r t s a t t h e top of t h e f i l e again .
66 Return ! C l o s e s t h e do − l o o p and t h u s t h e f u n c t i o n .
67 End I f
68
69 nSeparators = nSeparators + 1
70 posmin = posmin + p o s + l e n ( S e p a r a t o r )
71 End Do
72
73 End F u n c t i o n
74
75 ! −−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−
76
77 C h a r a c t e r ( 1 0 0 ) F u n c t i o n S h o r t ( Long )
78 ! E n a b l e s a s h o r t c u t t o a b b r e v i a t e d words .
79 I m p l i c i t None
80
81 Character (*) :: Long
82
83 S e l e c t Case ( Long )
84
85 Case ( ’ Den H e l d e r ’ )
86
87 Short = ’DH’
88
89 Case ( ’ T e x e l ’ )
90
91 Short = ’T ’
92
93 Case D e f a u l t
94
95 W r i t e ( * , ’ (A) ’ ) " T h e r e i s no programmed s h o r t f o r t h i s word . "
96
97 End S e l e c t
98
99 End F u n c t i o n
100
101 ! −−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−
102
103 Real F u n c t i o n Average ( Vector )
104 ! C a l c u l a t e s t h e a v e r a g e o f an v e c t o r , e x c l u d i n g 0
105 I m p l i c i t None
106
107 Real :: Vector ( : )
108
109 A v e r a g e = Sum ( V e c t o r ) / Count ( V e c t o r > 0 )
110
111 End F u n c t i o n
112
232 F. Code of the MarsdiepVisual Program
113 ! −−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−
114 ! SUBROUTINES
115 ! −−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−
116 ! Reading i n
117 ! −−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−
118
119 S u b r o u t i n e R e a d i n g F i l e C S V _ S u r ( F i l e , N l i n e s _ s u r , DateTime_Sur , J o i n t , CL ,MD, I n c l i n a t i o n R a w ,
AzimuthRaw , B t o t , Dip , E l e v a t i o n C a l c , ElevationMGS , Away , R_Calc , R_MGS)
120 ! C o n t a i n i n g h e a d e r , 1 s t column d a t e ( dd −mm− yy ) , 2 nd column t i m e ( hh :mm) , j u s t r e a l numbers
t h e o t h e r columns , b e s i d e s number 11 which c o n t a i n s i n t e g e r s . Columns s e p a r a t e d by " , " .
121 I m p l i c i t None
122
123 Integer :: File
124 Character (130) :: Header
125 Integer , allocatable :: Date_I ( : )
126 Real , allocatable :: Time_R ( : )
127 Integer , allocatable :: J o i nt ( : ) , Btot ( : )
128 Real , allocatable :: CL ( : ) ,MD( : ) , I n c l i n a t i o n R a w ( : ) , AzimuthRaw ( : )
129 Real , allocatable :: Dip ( : ) , ElevationMGS ( : )
130 Real ( 8 ) , allocatable :: ElevationCalc ( : )
131 Real ( 8 ) , allocatable :: R_Calc ( : )
132 Real ( 8 ) , allocatable :: Away ( : )
133 Real , allocatable :: R_MGS ( : )
134 Integer :: n l i n e s , i , io , n l i n e s _ d a t a , N l i n e s _ s u r
135 Character (19) , Allocatable :: DateTime_Sur ( : )
136
137 n l i n e s = LINECOUNT ( F i l e )
138
139 n l i n e s _ d a t a = n l i n e s −1 ! File contains headers .
140
141 Write ( * , * )
142 W r i t e ( * , ’ (A, I7 , A) ’ ) " The S u r v e y f i l e i s r e a d and " , n l i n e s _ d a t a , " l i n e s c o n t a i n i n g d a t a a r e
found . "
143
144 Allocate ( Date_I ( n l i n e s _ d a t a ) )
145 A l l o c a t e ( Time_R ( n l i n e s _ d a t a ) )
146 Allocate ( Joint ( nlines_data ) )
147 Allocate ( Btot ( nlines_data ) )
148 A l l o c a t e ( CL ( n l i n e s _ d a t a ) )
149 A l l o c a t e (MD( n l i n e s _ d a t a ) )
150 A l l o c a t e ( InclinationRAW ( n l i n e s _ d a t a ) )
151 A l l o c a t e ( AzimuthRaw ( n l i n e s _ d a t a ) )
152 A l l o c a t e ( Dip ( n l i n e s _ d a t a ) )
153 Allocate ( ElevationCalc ( nlines_data ) )
154 A l l o c a t e ( ElevationMGS ( n l i n e s _ d a t a ) )
155 A l l o c a t e ( Away ( n l i n e s _ d a t a ) )
156 A l l o c a t e ( R_Calc ( n l i n e s _ d a t a ) )
157 A l l o c a t e (R_MGS( n l i n e s _ d a t a ) )
158
159 Read ( f i l e , ’ ( A100 ) ’ ) Header
160
161 Do i =1 , n l i n e s _ d a t a −1 ! The " − 1" a c c o u n t s f o r t h e l i n e r e a d two l i n e s a b o v e t h i s s e n t e n c e
.
162 Read ( f i l e , ’ ( I5 , 1 x , F17 . 1 5 , 1 x , I , 9 ( F ) , F4 . 3 , F9 . 4 , F ) ’ , IOSTAT= i o ) D a t e _ I ( i ) , Time_R ( i ) , J o i n t ( i ) ,
CL ( i ) ,MD( i ) , I n c l i n a t i o n R a w ( i ) , AzimuthRaw ( i ) , B t o t ( i ) , Dip ( i ) , E l e v a t i o n C a l c ( i ) , ElevationMGS (
i ) , Away ( i ) , R_Calc ( i ) ,R_MGS( i )
163
164 I f ( i o > 0 ) Then
165 w r i t e ( * , * ) " Check i n p u t , s o m e t h i n g i s wrong , u n i t w i s e . . . "
166 exit
167 E l s e i f ( i o < 0 ) Then
168 w r i t e ( * , * ) " End o f f i l e i s r e a c h e d , b e f o r e end o f l o o p . Some l i n e s may c o n t a i n no
data or rubbish . "
169 Exit
170 End I f
171 End Do
172
173 N l i n e s _ s u r = n l i n e s _ d a t a −1 ! The " − 1" i s t o a c c o u n t f o r s k i p p i n g t h e s e c o n d l i n e
174
175 C a l l DateTimeFromSur ( DateTime_Sur , D a t e _ I , Time_R , N l i n e s _ s u r )
176
233
177 D e a l l o c a t e ( D a t e _ I , Time_R )
178
179 End S u b r o u t i n e
180
181 ! −−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−
182
183 S u b r o u t i n e R e a d i n g F i l e S a m p l e D a t a ( L o c a t i o n , F i l e , No_Samples , DateTime_Samples , Sample_ID , Temp , EC ,
pH , MF, Rho , SC , RPM_600 , RPM_300 , RPM_200 , RPM_100 , RPM_60 , RPM_30 , RPM_6 , RPM_3 , Gel10s , Gel10min )
184 ! C o n t a i n i n g h e a d e r , 1 s t column d a t e ( dd −mm− yy ) , 2 nd column t i m e ( hh :mm) , j u s t r e a l numbers
t h e o t h e r columns , b e s i d e s number 11 which c o n t a i n s i n t e g e r s . Columns s e p a r a t e d by " , " .
185 I m p l i c i t None
186
187 Integer :: File
188 Character (130) :: Header
189 Integer , Allocatable :: Date_I ( : )
190 Real , Allocatable : : Time_R ( : )
191 Integer :: n l i n e s , i , i o , n l i n e s _ d a t a , No_Samples
192 Character (19) , Allocatable :: DateTime_Samples ( : )
193 Character ( len =:) , Allocatable :: Sample_ID ( : )
194 Real , Allocatable : : Temp ( : ) ,EC ( : ) , pH ( : ) ,MF ( : ) , Rho ( : ) , SC ( : )
195 Integer , Allocatable : : RPM_600 ( : ) , RPM_300 ( : ) , RPM_200 ( : ) , RPM_100 ( : ) , RPM_60 ( : ) ,
RPM_30 ( : ) ,RPM_6 ( : ) ,RPM_3 ( : ) , G e l 1 0 s ( : ) , Gel10min ( : )
196 Character (10) :: Location
197
198 n l i n e s = LINECOUNT ( F i l e )
199
200 n l i n e s _ d a t a = n l i n e s −1 ! File contains headers .
201
202 Write ( * , * )
203 W r i t e ( * , ’ (A, I7 , A) ’ ) " The Sample f i l e i s r e a d and " , n l i n e s _ d a t a , " l i n e s c o n t a i n i n g d a t a a r e
found . "
204
205 Allocate ( Date_I ( n l i n e s _ d a t a ) )
206 A l l o c a t e ( Time_R ( n l i n e s _ d a t a ) )
207
208 S e l e c t Case ( L o c a t i o n )
209 Case ( ’ Den H e l d e r ’ )
210 Allocate ( character (14) :: Sample_ID ( n l i n e s _ d a t a ) )
211
212 Case ( ’ T e x e l ’ )
213 Allocate ( character (11) :: Sample_ID ( n l i n e s _ d a t a ) )
214
215 Case D e f a u l t
216 W r i t e ( * , ’ (A) ’ ) " L o c a t i o n i s unknown , p r o g r a m i s t e r m i n a t e d . "
217 Pause
218 Stop
219
220 End S e l e c t
221
222 A l l o c a t e ( Temp ( n l i n e s _ d a t a ) )
223 A l l o c a t e ( EC ( n l i n e s _ d a t a ) )
224 A l l o c a t e ( pH ( n l i n e s _ d a t a ) )
225 A l l o c a t e (MF( n l i n e s _ d a t a ) )
226 A l l o c a t e ( Rho ( n l i n e s _ d a t a ) )
227 A l l o c a t e ( SC ( n l i n e s _ d a t a ) )
228 A l l o c a t e ( RPM_600 ( n l i n e s _ d a t a ) )
229 A l l o c a t e ( RPM_300 ( n l i n e s _ d a t a ) )
230 A l l o c a t e ( RPM_200 ( n l i n e s _ d a t a ) )
231 A l l o c a t e ( RPM_100 ( n l i n e s _ d a t a ) )
232 A l l o c a t e ( RPM_60 ( n l i n e s _ d a t a ) )
233 A l l o c a t e ( RPM_30 ( n l i n e s _ d a t a ) )
234 A l l o c a t e ( RPM_6 ( n l i n e s _ d a t a ) )
235 A l l o c a t e ( RPM_3 ( n l i n e s _ d a t a ) )
236 A l l o c a t e ( Gel10s ( n l i n e s _ d a t a ) )
237 A l l o c a t e ( Gel10min ( n l i n e s _ d a t a ) )
238
239 Read ( f i l e , ’ ( A100 ) ’ ) Header
240
241 Do i =1 , n l i n e s _ d a t a
242 Read ( f i l e , ’ ( I5 , 1 x , F17 . 1 5 , 1 x , A, 1 x , 3 ( F5 . 2 , 1 x ) , F6 . 2 , 1 x , 2 ( F5 . 2 , 1 x ) , 1 0 ( I ) ) ’ , IOSTAT= i o ) D a t e _ I (
i ) , Time_R ( i ) , Sample_ID ( i ) , Temp ( i ) ,EC ( i ) , pH ( i ) ,MF( i ) , Rho ( i ) , SC ( i ) , RPM_600 ( i ) , RPM_300 ( i ) ,
234 F. Code of the MarsdiepVisual Program
308 A l l o c a t e ( SourceAwayTot ( n l i n e s _ d a t a ) )
309 Allocate ( SourceRightTot ( nlines_data ) )
310 Allocate ( PositionBitAll ( nlines_data ) )
311
312 Read ( F i l e , * ) ! Skips headers .
313
314 Do i = 1 , n l i n e s _ d a t a
315 Read ( F i l e , ’ ( 2 (A) , 6 ( F ) ) ’ , IOSTAT= i o ) SampleCode ( i ) , D a t e T i m e S a m p l e s ( i ) , SamplingAwayTot ( i ) ,
S a m p l i n g D e p t h T o t ( i ) , S a m p l i n g R i g h t T o t ( i ) , SourceAwayTot ( i ) , S o u r c e D e p t h T o t ( i ) , S o u r c e R i g h t T o t
(i)
316
317 I f ( i o > 0 ) Then
318 W r i t e ( * , ’ (A) ’ ) " Check i n p u t , s o m e t h i n g i s wrong , u n i t w i s e . . . "
319 Exit
320 E l s e i f ( i o < 0 ) Then
321 W r i t e ( * , ’ (A) ’ ) " End o f f i l e i s r e a c h e d , b e f o r e end o f l o o p . Some l i n e s may c o n t a i n no
data or rubbish . "
322 Exit
323 End i f
324
325 End Do
326
327 End S u b r o u t i n e
328
329 ! −−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−
330
331 S u b r o u t i n e R e a d i n g F i l e S i e v e ( F i l e , Sample_Code , D)
332 ! Reads t h e s i e v e f i l e , c a n be g e n e r a l i z e d t o be a p p l i c a b l e t o f i l e s w i t h v a r i a b l e p a r a m e t e r
lengths .
333 I m p l i c i t None
334
335 Integer :: File
336 Integer :: n l i n e s , n l i n e s _ d a t a , i , io , j
337 Character (31) , Allocatable :: GefFileName ( : )
338 Character (7) , Allocatable :: Boring_Code ( : )
339 Character (3) , Allocatable : : NEN5104_Code ( : )
340 Character (7) , Allocatable : : Sample_No ( : )
341 Character (14) , Allocatable : : Sample_Code ( : )
342 Character (17) , Allocatable :: Depth ( : )
343 Character (1) :: lineTemp
344 Character (2048) :: Line
345 Integer : : Posmin , Posmax , Pos
346 Character (40) , Allocatable : : Var ( : )
347 Character :: Separator
348 Integer : : nColumns
349 Character (2) : : Number
350 Character (7) : : Code
351 Real , Allocatable : : D( : , : )
352 Integer : : count
353
354 n l i n e s = LineCount ( F i l e )
355 n l i n e s _ d a t a = n l i n e s −1 ! File contains headers .
356
357 A l l o c a t e (D( n l i n e s _ d a t a , 9 9 ) ) ! (y , x)
358
359 Separator = " , "
360 nColumns = ColumnCount ( F i l e , S e p a r a t o r )
361
362 W r i t e ( * , * ) " ColumnCount : " , nColumns
363
364 Write ( * , * )
365 W r i t e ( * , ’ (A, I7 , A) ’ ) ’ The S i e v e f i l e i s r e a d and ’ , n l i n e s _ d a t a , ’ l i n e s c o n t a i n i n g d a t a a r e
found . ’
366
367 A l l o c a t e ( Var ( nColumns ) )
368 A l l o c a t e ( GefFileName ( n l i n e s _ d a t a ) )
369 A l l o c a t e ( Boring_Code ( n l i n e s _ d a t a ) )
370 A l l o c a t e ( NEN5104_Code ( n l i n e s _ d a t a ) )
371 A l l o c a t e ( Sample_No ( n l i n e s _ d a t a ) )
372 A l l o c a t e ( Sample_Code ( n l i n e s _ d a t a ) )
373 A l l o c a t e ( Depth ( n l i n e s _ d a t a ) )
236 F. Code of the MarsdiepVisual Program
374
375 Read ( F i l e , ’ (A) ’ ) ! Skips headers
376
377 Do j = 1 , n l i n e s _ d a t a
378 Read ( F i l e , ’ (A) ’ ) L i n e
379
380 posmin = 1
381 posmax = −1
382 Count = 0
383
384 Do i =1 , nColumns
385
386 Pos = i n d e x ( L i n e ( Posmin : ) , " , " )
387 I f ( Pos == 0 ) Then
388 Var ( i ) = L i n e ( Posmin : )
389 ! W r i t e ( * , ’ ( A, I4 , A, A, A, I5 , A, I 5 ) ’ ) " i , Var ( i ) , Posmin , Posmax : " , i , " , " , t r i m ( Var ( i )
) , " , " , Posmin , " , " , Posmax
390 Exit
391 End I f
392
393 Count = c o u n t + 1
394 ! I f ( i == 1 0 ) P a u s e
395
396 I f ( Count == 5 ) e x i t
397
398 Posmax = Posmax + Pos
399 Var ( i ) = L i n e ( Posmin : Posmax )
400 Posmin = Posmin + Pos
401
402 End Do
403
404 Read ( Var ( 2 ) , ’ (A) ’ ) Boring_Code ( j )
405 Read ( Var ( 3 ) , ’ (A) ’ ) NEN5104_Code ( j )
406 Read ( Var ( 4 ) , ’ (A) ’ ) Sample_No ( j )
407
408 ! G i v i n g t h e g e f r e s u l t s t h e same c o d e a s u s e d i n t h e o t h e r f i l e s .
409
410 Code = Sample_No ( j )
411 Read ( Code ( Len ( t r i m ( Code ) ) − 1 : ) , ’ ( A2 ) ’ ) Number
412
413 I f ( I n d e x ( B o r i n g _ C o d e ( j ) , "A1" ) > 0 . and . I n d e x ( B o r i n g _ C o d e ( j ) , "DH" ) > 0 ) Then
414 Sample_Code ( j ) = "PB1DH−A1−65− " / / Number
415 E l s e I f ( I n d e x ( B o r i n g _ C o d e ( j ) , "A3" ) > 0 . and . I n d e x ( B o r i n g _ C o d e ( j ) , "DH" ) > 0 ) Then
416 Sample_Code ( j ) = "PB1DH−A3−85− " / / Number
417 E l s e I f ( I n d e x ( B o r i n g _ C o d e ( j ) , " B65 " ) > 0 . and . I n d e x ( B o r i n g _ C o d e ( j ) , "TXL" ) > 0 ) Then
418 Sample_Code ( j ) = "B−65−TXL− " / / Number
419 E l s e I f ( I n d e x ( B o r i n g _ C o d e ( j ) , " C85 " ) > 0 . and . I n d e x ( B o r i n g _ C o d e ( j ) , "TXL" ) > 0 ) Then
420 Sample_Code ( j ) = "C−85−TXL− " / / Number
421 Else ! The v e r t i c a l f i l e o r o t h e r f i l e s .
422 Sample_Code ( j ) = t r i m ( B o r i n g _ C o d e ( j ) ) / / " − " / / t r i m ( Sample_No ( j ) )
423 ! W r i t e ( * , * ) Sample_Code ( j )
424 End I f
425
426 End Do
427
428 Rewind ( F i l e )
429
430 Read ( F i l e , * ) ! Skips headers
431 Do j = 1 , n L i n e s _ d a t a
432 count = 0
433 Do While ( . TRUE . )
434 Read ( F i l e , ’ (A) ’ , Advance = ’No ’ ) l i n e T e m p
435 ! W r i t e ( * , ’ (A) ’ ) l i n e T e m p
436 I f ( l i n e T e m p == ’ , ’ ) c o u n t = c o u n t + 1
437 I f ( c o u n t == 5 ) e x i t
438 End Do
439
440 Read ( F i l e , * ) D( j , : )
441 End Do
442
443 End S u b r o u t i n e
237
444
445 ! −−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−
446
447 S u b r o u t i n e R e a d i n g F i l e S i e v e V 2 ( F i l e , Sample_Code , D)
448 ! Reads t h e s i e v e f i l e V2 , c a n be g e n e r a l i z e d t o be a p p l i c a b l e t o f i l e s w i t h v a r i a b l e
parameter lengths .
449 I m p l i c i t None
450
451 Integer :: File
452 Integer :: n l i n e s , n l i n e s _ d a t a , i , io , j
453 Character (31) , Allocatable :: GefFileName ( : )
454 Character (7) , Allocatable :: Boring_Code ( : )
455 Character (3) , Allocatable :: NEN5104_Code ( : )
456 Character (7) , Allocatable :: Sample_No ( : )
457 Character (14) , Allocatable :: Sample_Code ( : )
458 Character (17) , Allocatable :: Depth ( : )
459 Character (1) :: lineTemp
460 Character (2048) :: Line
461 Integer :: Posmin , Posmax , Pos
462 Character (40) , Allocatable :: Var ( : )
463 Character :: Separator
464 Integer :: nColumns
465 Character (2) :: Number
466 Character (7) :: Code
467 Real , Allocatable :: D( : , : )
468 Integer :: count
469 Real , Allocatable :: Mass_Sand ( : )
470 Character (6) , Allocatable :: Sieve_Code ( : )
471 Real , Allocatable :: Avg_GrainSize ( : )
472 Character :: Temp
473 Character (2) :: Temp2
474
475 n l i n e s = LineCount ( F i l e )
476 n l i n e s _ d a t a = n l i n e s −1 ! File contains headers .
477
478 A l l o c a t e (D( n l i n e s _ d a t a , 9 9 ) ) ! (y , x)
479
480 Separator = " , "
481 nColumns = ColumnCount ( F i l e , S e p a r a t o r )
482
483 Write ( * , * )
484 W r i t e ( * , ’ (A, I7 , A) ’ ) ’ The S i e v e f i l e V2 i s r e a d and ’ , n l i n e s _ d a t a , ’ l i n e s c o n t a i n i n g d a t a a r e
found . ’
485
486 A l l o c a t e ( Var ( nColumns ) )
487 A l l o c a t e ( Sieve_Code ( n l i n e s _ d a t a ) )
488 A l l o c a t e ( Mass_Sand ( n l i n e s _ d a t a ) )
489 Allocate ( Avg_Grainsize ( n l i n e s _ d a t a ) )
490 A l l o c a t e ( Sample_No ( n l i n e s _ d a t a ) )
491 A l l o c a t e ( Sample_Code ( n l i n e s _ d a t a ) )
492
493 Read ( F i l e , ’ (A) ’ ) ! Skips headers
494
495 Do j = 1 , n l i n e s _ d a t a
496 Read ( F i l e , ’ (A) ’ ) L i n e
497
498 posmin = 1
499 posmax = −1
500 Count = 0
501
502 Do i =1 ,6
503
504 Pos = i n d e x ( L i n e ( Posmin : ) , " , " )
505 I f ( Pos == 0 ) Then
506 Var ( i ) = L i n e ( Posmin : )
507 ! W r i t e ( * , ’ ( A, I4 , A, A, A, I5 , A, I 5 ) ’ ) " i , Var ( i ) , Posmin , Posmax : " , i , " , " , t r i m ( Var ( i )
) , " , " , Posmin , " , " , Posmax
508 Exit
509 End I f
510
511 Count = c o u n t + 1
238 F. Code of the MarsdiepVisual Program
512
513 Posmax = Posmax + Pos
514 Var ( i ) = L i n e ( Posmin : Posmax )
515 Posmin = Posmin + Pos
516
517 I f ( Count == 4 ) e x i t
518
519 End Do
520
521 Read ( Var ( 1 ) , ’ (A) ’) Sieve_Code ( j )
522 Read ( Var ( 2 ) , ’ (A) ’) Sample_Code ( j )
523 Read ( Var ( 3 ) , ’ (F) ’) Mass_Sand ( j )
524 Read ( Var ( 4 ) , ’ (F) ’) Avg_Grainsize ( j )
525
526 End Do
527
528 Rewind ( F i l e )
529
530 Read ( F i l e , * ) ! Skips headers
531 Do j = 1 , n L i n e s _ d a t a
532 count = 0
533 Do While ( . TRUE . )
534 Read ( F i l e , ’ (A) ’ , Advance = ’No ’ ) l i n e T e m p
535 I f ( l i n e T e m p == ’ , ’ ) c o u n t = c o u n t + 1
536 I f ( c o u n t == 4 ) e x i t
537 End Do
538
539 Read ( F i l e , * ) D( j , : )
540 End Do
541
542 D e a l l o c a t e ( Var )
543
544 End S u b r o u t i n e
545
546 ! −−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−
547
548 S u b r o u t i n e R e a d i n g F i l e F o r m a t i o n s ( F i l e , Sample_Code , Fm_No , Fm)
549 ! Reads t h e f i l e w i t h f o r m a t i o n s a s s i g n e d by TNO
550 I m p l i c i t None
551
552 Integer :: n l i n e s , n l i n e s _ d a t a , i , i o , IOSTAT , j
553 Integer :: File
554 Integer , A l l o c a t a b l e : : Fm_No ( : )
555 Character (100) , A l l o c a t a b l e : : Fm ( : )
556 Character (14) , A l l o c a t a b l e : : Sample_Code ( : )
557 Character :: Separator
558 Integer : : nColumns , Count
559 Character (1) :: lineTemp
560 Character (2048) :: Line
561 Integer : : Posmin , Posmax , Pos
562 Character (40) , A l l o c a t a b l e : : Var ( : )
563
564 n l i n e s = LineCount ( F i l e )
565 n l i n e s _ d a t a = n l i n e s −1 ! File contains headers .
566
567 Separator = " , "
568 nColumns = ColumnCount ( F i l e , S e p a r a t o r )
569
570 Write ( * , * )
571 W r i t e ( * , ’ (A, I3 , A) ’ ) ’ The F o r m a t i o n TNO f i l e i s r e a d and ’ , n l i n e s _ d a t a , ’ l i n e s c o n t a i n i n g d a t a
a r e found . ’
572
573 A l l o c a t e ( Fm_No ( n l i n e s _ d a t a ) )
574 A l l o c a t e (Fm( n l i n e s _ d a t a ) )
575 A l l o c a t e ( Sample_Code ( n l i n e s _ d a t a ) )
576 A l l o c a t e ( Var ( nColumns ) )
577
578 Read ( F i l e , * ) ! Skips headers .
579
580 Do j = 1 , n l i n e s _ d a t a
581 Read ( F i l e , ’ (A) ’ ) L i n e
239
582
583 posmin = 1
584 posmax = −1
585 Count = 0
586
587 Do i =1 ,6
588
589 Pos = i n d e x ( L i n e ( Posmin : ) , " , " )
590 I f ( Pos == 0 ) Then
591 Var ( i ) = L i n e ( Posmin : )
592 ! W r i t e ( * , ’ ( A, I4 , A, A, A, I5 , A, I 5 ) ’ ) " i , Var ( i ) , Posmin , Posmax : " , i , " , " , t r i m ( Var ( i )
) , " , " , Posmin , " , " , Posmax
593 Exit
594 End I f
595
596 Count = c o u n t + 1
597
598 Posmax = Posmax + Pos
599 Var ( i ) = L i n e ( Posmin : Posmax )
600 Posmin = Posmin + Pos
601
602 I f ( Count == 2 ) e x i t
603
604 End Do
605
606 Read ( Var ( 1 ) , ’ (A) ’ ) Sample_Code ( j )
607
608 Read ( Var ( 2 ) , ’ ( I ) ’ ) Fm_No ( j )
609
610 End Do
611
612 Rewind ( F i l e )
613
614 Read ( F i l e , * ) ! Skips headers
615 Do j = 1 , n L i n e s _ d a t a
616 count = 0
617 Do While ( . TRUE . )
618 Read ( F i l e , ’ (A) ’ , Advance = ’No ’ ) l i n e T e m p
619 I f ( l i n e T e m p == ’ , ’ ) c o u n t = c o u n t + 1
620 I f ( c o u n t == 2 ) e x i t
621 End Do
622
623 Read ( F i l e , * ) Fm( j )
624 End Do
625
626 D e a l l o c a t e ( Var )
627
628 End S u b r o u t i n e
629
630 ! −−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−
631
632 S u b r o u t i n e R e a d i n g F i l e O u t p u t T x t ( L o c a t i o n , F i l e , Var , SampleCode , DateTimeSamples , Col01 , Col02 ,
Col03 , Col04 , Col05 , Col06 , Col07 , Col08 , Col09 , Col10 , Col11 , Col12 , Col13 , Col14 , Col15 , Col16 , Col17
, Col18 )
633 ! G e n e r a l i z e d r e a d i n g s u b r o u t i n e , r e a d f i l e w i t h h e a d e r and s a m p l e c o d e i n t h e 1 s t column ,
d a t e t i m e s a m p l e i n t h e s e c o n d column , o t h e r c o l u m n s a r e u n s p e c i f i e d b u t o f t h e r e a l t y p e .
634 I m p l i c i t None
635
636 Integer :: File
637 Character (19) , Allocatable :: DateTimeSamples ( : )
638 Character ( len =:) , A l l o c a t a b l e : : SampleCode ( : )
639 Character (*) :: Location
640 Integer :: nlines , nlines_data , i , io
641 Real , Allocatable : : Col01 ( : ) , Col02 ( : ) , Col03 ( : ) , Col04 ( : ) , Col05 ( : ) , Col06 ( : )
642 Real , O p t i o n a l , Allocatable : : Col07 ( : ) , Col08 ( : ) , Col09 ( : ) , Col10 ( : ) , Col11 ( : ) , Col12 ( : )
643 Real , O p t i o n a l , Allocatable : : Col13 ( : ) , Col14 ( : ) , Col15 ( : ) , Col16 ( : ) , Col17 ( : ) , Col18 ( : )
644 Character :: Separator
645 Integer : : nColumns , Count
646 Character (1) :: lineTemp
647 Character (2048) :: Line
648 Integer : : Posmin , Posmax , Pos
240 F. Code of the MarsdiepVisual Program
835 Integer :: Y
836
837 Integer (2) :: Hours , Hours_Min , Hours_Max
838 Integer (2) :: Day , Day_Min , Day_Max
839 Integer (2) :: Month , Month_Min , Month_Max
840 Integer (4) :: Year
841 Integer (2) :: Minutes , Seconds
842
843
844 Read ( D a t e T i m e S o u r c e , ’ ( I2 , 1 x , I2 , 1 x , I4 , 1 x , I2 , 1 x , I2 , 1 x , I 2 ) ’ ) Day , Month , Year , Hours , M i n u t e s ,
Seconds
845
846 Hours_Min = Hours − 2 *Y
847 Day_Min = Day
848 Month_Min = Month
849
850 I f ( Hours_Min < 0 ) Then
851 Hours_Min = 24 + Hours_min
852 Day_Min = Day_Min − 1
853 End I f
854
855 ! Day_Min c a n become 0 o r l e s s s o t h a n t h e month h a s t o be r e d u c e d and day_min becomes t h e
l a s t o r t h e x t o l a s t day o f t h a t month .
856 I f ( Day_Min < 1 ) Then
857 I f ( ( Month − 1) == 1 . o r . ( Month − 1) == 3 . o r . ( Month − 1) == 5 . o r . ( Month − 1) == 7 . o r . (
Month − 1) == 8 . o r . ( Month − 1) == 10 . o r . ( Month − 1) == 1 2 ) Then
858 Day_Min = 31 + Day_Min
859 Month_Min = Month − 1
860 E l s e I f ( ( Month − 1) == 4 . o r . ( Month − 1) == 6 . o r . ( Month − 1) == 9 . o r . ( Month − 1) == 1 1 )
Then
861 Day_Min = 30 + Day_Min
862 Month_Min = Month − 1
863 E l s e I f ( ( Month − 1) == 2 ) Then
864 Day_Min = 28 + Day_Min
865 Month_Min = Month − 1
866 End I f
867 End I f
868
869 W r i t e ( DateTimeMin , ’ ( 2 ( I 2 . 2 , A1 ) , I4 , 1 x , 2 ( I 2 . 2 , A1 ) , I 2 . 2 ) ’ ) Day_Min , " − " , Month_Min , " − " , Year ,
Hours_Min , " : " , M i n u t e s , " : " , S e c o n d s
870
871 Hours_Max = Hours + Y
872 Day_Max = Day
873 Month_Max = Month
874
875 I f ( Hours_Max > 2 3 ) Then ! 2 3 : 5 9 becomes 0 0 : 0 0 t h e n e x t day
876 Hours_Max = Hours_Max − 24
877 Day_Max = Day_Max + 1
878 End I f
879
880 I f ( Day_Max > 3 1 ) Then
881 I f ( ( Month ) == 1 . o r . ( Month ) == 3 . o r . ( Month ) == 5 . o r . ( Month ) == 7 . o r . ( Month ) == 8
. o r . ( Month ) == 10 . o r . ( Month ) == 1 2 ) Then
882 Day_Max = Day_Max − 31
883 Month_Max = Month + 1
884 E l s e I f ( ( Month ) == 4 . o r . ( Month ) == 6 . o r . ( Month ) == 9 . o r . ( Month ) == 1 1 ) Then
885 Day_Max = Day_Max − 30
886 Month_Max = Month + 1
887 E l s e I f ( ( Month ) == 2 ) Then
888 Day_Max = Day_Max − 28
889 Month_Max = Month + 1
890 End I f
891 E l s e I f ( Day_Max > 3 0 ) Then
892 I f ( ( Month ) == 4 . o r . ( Month ) == 6 . o r . ( Month ) == 9 . o r . ( Month ) == 1 1 ) Then
893 Day_Max = Day_Max − 30
894 Month_Max = Month + 1
895 E l s e I f ( ( Month ) == 2 ) Then
896 Day_Max = Day_Max − 28
897 Month_Max = Month + 1
898 End I f
899 E l s e I f ( Day_Max > 2 8 ) Then
244 F. Code of the MarsdiepVisual Program
968 End4th = i
969 Exit
970 End I f
971 W r i t e ( 1 3 , ’ ( F9 . 3 , 2 ( 1 x , F9 . 3 ) ) ’ ) x d a t a 1 ( i ) , y d a t a 1 ( i ) , z d a t a 1 ( i )
972 End Do
973
974 I f ( E n d 4 t h > 0 ) Then
975 Do i = E n d 4 t h +1 , n1 −1
976 W r i t e ( 1 4 , ’ ( F9 . 3 , 2 ( 1 x , F9 . 3 ) ) ’ ) x d a t a 1 ( i ) , y d a t a 1 ( i ) , z d a t a 1 ( i )
977 End do
978 End I f
979
980 CLOSE ( 1 0 , S t a t u s = ’KEEP ’ )
981 CLOSE ( 1 1 , S t a t u s = ’KEEP ’ )
982 CLOSE ( 1 2 , S t a t u s = ’KEEP ’ )
983 CLOSE ( 1 3 , S t a t u s = ’KEEP ’ )
984 CLOSE ( 1 4 , S t a t u s = ’KEEP ’ )
985
986 ! C r e a t e g n u p l o t command f i l e
987 ! −−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−
988 OPEN( 1 0 , ACCESS= ’SEQUENTIAL ’ , FILE= ’ gp . t x t ’ )
989 W r i t e ( 1 0 , ’ (A) ’ ) ’ s e t t e r m i n a l png s i z e 2 4 0 0 , 1 6 0 0 ’
990 W r i t e ( 1 0 , ’ (A) ’ ) ’ s e t o u t p u t ’ / / ’ " ’ / / ’D : / h i j n e k a m / D e s k t o p / Program / G r a p h s / ’ / / t r i m ( t i t l e 0 ) / / ’ .
png ’ / / ’ " ’ ! C r e a t e s . png f i l e and s t o r e s i t i n a d i f f e r e n t f o l d e r . The " / "
u s e d i s d i f f e r e n t from t h e d e f a u l t o r f o r t r a n ( " \ " ) ! ! !
991 W r i t e ( 1 0 , ’ (A) ’ ) ’ s e t t i t l e f o n t " , 2 4 " ’ / / ’ " { / : Bold ’ / / t r i m ( t i t l e 1 ) / / ’ } " ’
992
993 ! Graph T i t l e , t i t l e i n b o l d , works
994 W r i t e ( 1 0 , ’ (A) ’ ) ’ s e t x l a b e l f o n t " , 2 0 " ’ / / ’ " ’ / / Trim ( x l a b e l ) / / ’ " ’
995 W r i t e ( 1 0 , ’ (A) ’ ) ’ s e t y l a b e l f o n t " , 2 0 " ’ / / ’ " ’ / / Trim ( y l a b e l ) / / ’ " ’
996 W r i t e ( 1 0 , ’ (A) ’ ) ’ s e t z l a b e l f o n t " , 2 0 " ’ / / ’ " ’ / / Trim ( z l a b e l ) / / ’ " o f f s e t − 1 , − 0.4 ’ !
O f f s e t c h a n g e s t h e p o s i t i o n o f t h e t i t l e , i n t h i s c a s e l o w e r s i t , w / o i t t h e t i t l e and
t i c l a b e l s o v e r l a p . F i r s t number o f f s e t s t h e h o r i z o n t a l p o s i t i o n .
997 W r i t e ( 1 0 , ’ (A) ’ ) ’ s e t z r a n g e [ − 9 0 : 5 ] ’
998
999 S e l e c t Case ( L o c a t i o n )
1000
1001 Case ( ’ T e x e l ’ )
1002 Write (10 , * ) ’ set yrange [10: −10] r e v e r s e ’
1003 Write (10 , * ) ’ set f o r [ x = 0 : 1 8 0 0 : 2 0 0 ] a r r o w from x , − 10 , − 90 t o x , − 1 0 , 5 n o h e a d l t 0 lw 2 ’
1004 Write (10 , * ) ’ set f o r [ y = − 1 0 : 1 0 : 1 ] a r r o w from 0 , y , − 90 t o 0 , y , 5 n o h e a d l t 0 lw 2 ’
1005 Write (10 , * ) ’ set f o r [ y = − 1 0 : 1 0 : 1 ] a r r o w from 0 , y , − 90 t o 1 8 0 0 , y , − 90 n o h e a d l t 0 lw 2 ’
1006 Write (10 , * ) ’ set y t i c s f o n t " ,14" o f f s e t 0 , −0.5 ’
1007
1008 Case ( ’ Den H e l d e r ’)
1009 Write (10 , * ) ’ set yrange [10: −10] r e v e r s e ’
1010 Write (10 , * ) ’ set f o r [ x = 0 : 2 0 0 0 : 2 0 0 ] a r r o w from x , − 10 , − 90 t o x , − 1 0 , 5 n o h e a d l t 0 lw 2 ’
1011 Write (10 , * ) ’ set f o r [ y = − 1 0 : 1 0 : 1 ] a r r o w from 0 , y , − 90 t o 0 , y , 5 n o h e a d l t 0 lw 2 ’
1012 Write (10 , * ) ’ set f o r [ y = − 1 0 : 1 0 : 1 ] a r r o w from 0 , y , − 90 t o 2 0 0 0 , y , − 90 n o h e a d l t 0 lw 2 ’
1013 Write (10 , * ) ’ set y t i c s f o n t " ,14" o f f s e t 0 , −0.5 ’
1014
1015 End S e l e c t
1016
1017 Write (10 , * ) ’ s e t x t i c s f o n t " ,14" ’
1018 Write (10 , * ) ’ s e t z t i c s f o n t " ,14" ’
1019
1020 W r i t e ( 1 0 , ’ (A) ’ ) ’ s e t key f o n t " , 2 0 " o p a q u e r i g h t s p a c i n g 2 ’
1021 W r i t e ( 1 0 , * ) ’ s e t g r i d x t i c s z t i c s lw 2 ’
1022 W r i t e ( 1 0 , * ) ’ s e t view 7 0 , 6 0 ’
1023 W r i t e ( 1 0 , * ) ’ s e t x y p l a n e a t −90 ’ ! f o r c e s t h e i n t e r s e c t i o n o f t h e xy p l a n e w i t h
t h e z − a x i s t o be a t −90
1024
1025 Write (10 , * ) ’ s e t s t y l e l i n e 1 l c r g b ’ ’ # d d 1 8 1 f ’ ’ l t 1 lw 3 p t 7 p s 1 ’ ! Red ,
TranspLenSum
1026 Write (10 , * ) ’ s e t s t y l e l i n e 2 l c r g b " d a r k − b l u e " l t 1 lw 3 p t 7 p s 1 ’ ! ( d a r k ) Blue ,
Away
1027 Write (10 , * ) ’ s e t s t y l e l i n e 3 l c r g b ’ ’ # f f a 5 0 0 ’ ’ l t 1 lw 3 p t 7 p s 2 ’ ! Orange ,
TimeIntAvAll
1028 Write (10 , * ) ’ s e t s t y l e l i n e 4 l c r g b " d a r k − g r e e n " l t 1 lw 3 p t 7 p s 2 ’ ! ( d a r k ) Green
, PumpTime
1029
246 F. Code of the MarsdiepVisual Program
1030 S e l e c t Case ( L o c a t i o n )
1031
1032 Case ( ’ Den H e l d e r ’ )
1033 graphtitle1 = t r i m ( T i t l e 1 ) / / ’ NAP− 85m J e t b i t ’
1034 graphtitle2 = t r i m ( T i t l e 1 ) / / ’ NAP− 85m MudMotor ’
1035 graphtitle3 = t r i m ( T i t l e 1 ) / / ’ NAP− 65m J e t b i t ’
1036
1037 Case ( ’ T e x e l ’ )
1038 graphtitle1 = trim ( Title1 ) // ’ NAP− 65m Jet bit ’
1039 graphtitle2 = trim ( Title1 ) // ’ NAP− 65m MudMotor ’
1040 graphtitle3 = trim ( Title1 ) // ’ NAP− 85m Jet bit ’
1041 graphtitle4 = trim ( Title1 ) // ’ NAP− 85m Mudmotor ’
1042
1043 Case D e f a u l t
1044 W r i t e ( * , ’ (A) ’ ) " L o c a t i o n unknown , no p l o t i s made . "
1045 Read ( * , * )
1046 Return
1047
1048 End S e l e c t
1049
1050 W r i t e ( 1 0 , ’ (A) ’ ) ’ s p l o t " x y z d a t a 1 . d a t " u s i n g 1 : 2 : 3 w i t h l i n e s l s 1 t i t l e " ’ / / t r i m ( g r a p h t i t l e 1 )
/ / ’ " ," xyzdata2 . dat " using 1:2:3 with l i n e s l s 2 t i t l e " ’ / / trim ( g r a p h t i t l e 2 ) / / ’ " ," xyzdata3
. dat " using 1:2:3 with l i n e s l s 3 t i t l e " ’ / / trim ( g r a p h t i t l e 3 ) / / ’ " ," xyzdata4 . dat " using
1:2:3 with l i n e s l s 4 t i t l e " ’ / / trim ( g r a p h t i t l e 4 ) / / ’ " ," xyzdata5 . dat " using 1:2:3 with
lines ls 1 t i t l e " ’ / / trim ( graphtitle3 ) / / ’" ’
1051
1052 CLOSE ( 1 0 , STATUS= ’KEEP ’ )
1053
1054 ! P l o t c u r v e w i t h g n u p l o t and c l e a n u p f i l e s
1055 ! −−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−
1056 C a l l SYSTEM( ’ g n u p l o t gp . t x t ’ )
1057
1058 ! Pause ! To c h e c k t h e gnu f i l e b e f o r e d e l e t i o n i f t h e g r a p h i s n o t a s e x p e c t e d
.
1059
1060 Call SYSTEM( ’ del gp . t x t ’ )
1061 Call SYSTEM( ’ del xyzdata1 . dat ’)
1062 Call SYSTEM( ’ del xyzdata2 . dat ’)
1063 Call SYSTEM( ’ del xyzdata3 . dat ’)
1064 Call SYSTEM( ’ del xyzdata4 . dat ’)
1065 Call SYSTEM( ’ del xyzdata5 . dat ’)
1066
1067 ! Check m e s s a g e
1068 ! −−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−
1069 W r i t e ( * , ’ (A) ’ ) ’ F i l e ’ / / ’ " ’ / / t r i m ( t i t l e 0 ) / / ’ . png ’ / / ’ " ’ / / ’ i s c r e a t e d . ’
1070
1071 End S u b r o u t i n e
1072
1073 ! −−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−
1074
1075 S u b r o u t i n e f2gpRhData ( Location , xdata , ydata1 , s t y l e 1 , ydata2 , s t y l e 2 , ydata3 , s t y l e 3 , ydata4
, s t y l e 4 , ydata5 , s t y l e 5 , ydata6 , s t y l e 6 , ydata7 , s t y l e 7 , ydata8 , s t y l e 8 , ydata9 , style9 ,
ydata10 , style10 , t i t l e , xlabel , ylabel , g r a p h _ t i t l e 1 , g r a p h _ t i t l e 2 , g r a p h _ t i t l e 3 ,
graph_title4 , graph_title5 , graph_title6 , graph_title7 , graph_title8 , graph_title9 ,
graph_title10 )
1076 ! S u b r o u t i n e f2gpRHData p l o t s t h e r e s u l t s o f t h e v i s c o m e t e r
1077 I m p l i c i t None
1078
1079 Integer : : n1 ! number o f d a t a p o i n t s
1080 Character (*) :: xdata ( : ) ! f i r s t x data array
1081 Integer :: ydata1 ( : ) , ydata2 ( : ) , ydata3 ( : ) , ydata4 ( : ) , ydata5 ( : ) , ydata6 ( : ) , ydata7
( : ) , ydata8 ( : ) , ydata9 ( : ) , ydata10 ( : )
1082 C h a r a c t e r ( l e n =* ) :: xlabel , ylabel , t i t l e ! p l o t a x i s l a b e l s and
title (s)
1083 Character (10) :: Location
1084 Integer :: i
1085 Character (*) :: graph_title1 , graph_title2 , graph_title3 , graph_title4 , graph_title5 ,
graph_title6 , graph_title7 , graph_title8 , graph_title9 , graph_title10
1086 Character (2) :: style1 , style2 , style3 , style4 , style5 , style6 , style7 , style8 , style9 ,
style10
1087 Character (25) :: Layout1 , Layout2 , Layout3 , Layout4 , Layout5 , Layout6 , Layout7 ,
247
Layout8 , Layout9 , L a y o u t 1 0
1088
1089 n1 = s i z e ( x d a t a )
1090
1091 ! −−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−
1092 ! Write data in f i l e s
1093 ! −−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−
1094 OPEN( 1 0 , A c c e s s = ’SEQUENTIAL ’ , F i l e = ’ x y d a t a 1 . d a t ’ )
1095
1096 Do i = 1 , n1
1097 I f ( y d a t a 1 ( i ) == 0 . o r . y d a t a 2 ( i ) == 0 . o r . y d a t a 3 ( i ) == 0 . o r . y d a t a 4 ( i ) == 0 . o r .
y d a t a 5 ( i ) == 0 . o r . y d a t a 6 ( i ) == 0 . o r . y d a t a 7 ( i ) == 0 . o r . y d a t a 8 ( i ) == 0 ) Then
1098 Write (10 , * )
1099 Else
1100 W r i t e ( 1 0 , ’ (A, 1 x , I , 1 0 ( 1 x , I 3 . 3 ) ) ’ ) x d a t a ( i ) , i , y d a t a 1 ( i ) , y d a t a 2 ( i ) , y d a t a 3 ( i ) , y d a t a 4 ( i ) ,
ydata5 ( i ) , ydata6 ( i ) , ydata7 ( i ) , ydata8 ( i ) , ydata9 ( i ) , ydata10 ( i )
1101 End I f
1102 End Do
1103
1104 CLOSE ( 1 0 , S t a t u s = ’KEEP ’ )
1105
1106 ! C r e a t e g n u p l o t command f i l e
1107 ! −−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−
1108 OPEN( 1 0 , ACCESS= ’SEQUENTIAL ’ , FILE= ’ gp . t x t ’ )
1109 W r i t e ( 1 0 , ’ (A) ’ ) ’ s e t t e r m i n a l png s i z e 2 4 0 0 , 8 0 0 ’ ! Sets i t to create
. png
1110 W r i t e ( 1 0 , ’ (A) ’ ) ’ s e t o u t p u t ’ / / ’ " ’ / / ’D : / h i j n e k a m / D e s k t o p / Program / G r a p h s / P l o t ’ / / t r i m ( t i t l e ) / /
’ . png ’ / / ’ " ’ ! C r e a t e s . png f i l e and s t o r e s i t i n a d i f f e r e n t f o l d e r . The " / "
u s e d i s d i f f e r e n t from t h e d e f a u l t o r f o r t r a n ( " \ " ) ! ! !
1111 W r i t e ( 1 0 , ’ (A) ’ ) ’ s e t t i t l e ’ / / ’ " { / : Bold ’ / / T i t l e / / ’ } " ’ ! Graph T i t l e , t i t l e
i n b o l d , works
1112 W r i t e ( 1 0 , ’ (A) ’ ) ’ s e t x l a b e l ’ / / ’ " ’ / / Trim ( x l a b e l ) / / ’ " ’
1113 W r i t e ( 1 0 , ’ (A) ’ ) ’ s e t y l a b e l ’ / / ’ " ’ / / Trim ( y l a b e l ) / / ’ " ’
1114 W r i t e ( 1 0 , ’ (A) ’ ) ’ s e t key L e f t r i g h t o u t s i d e ’
1115 W r i t e ( 1 0 , ’ (A) ’ ) ’ s e t x t i c s r o t a t e by −45 ’
1116 W r i t e ( 1 0 , ’ (A) ’ ) ’ s e t g r i d ’ ! show g r i d l i n e s i n t h e xy p l a n e
1117
1118 Call GraphStyle ( Style1 , Layout1 )
1119 Call GraphStyle ( Style2 , Layout2 )
1120 Call GraphStyle ( Style3 , Layout3 )
1121 Call GraphStyle ( Style4 , Layout4 )
1122 Call GraphStyle ( Style5 , Layout5 )
1123 Call GraphStyle ( Style6 , Layout6 )
1124 Call GraphStyle ( Style7 , Layout7 )
1125 Call GraphStyle ( Style8 , Layout8 )
1126 Call GraphStyle ( Style9 , Layout9 )
1127 Call GraphStyle ( Style10 , Layout10 )
1128
1129 W r i t e ( 1 0 , ’ (A) ’ ) ’ p l o t " x y d a t a 1 . d a t " u s i n g 2 : 3 : x t i c l a b e l s ( 1 ) w i t h ’ / / t r i m ( L a y o u t 1 ) / / ’ t i t l e " ’
/ / TRIM ( g r a p h _ t i t l e 1 ) / / ’ " , " x y d a t a 1 . d a t " u s i n g 2 : 4 : x t i c l a b e l s ( 1 ) w i t h ’ / / L a y o u t 2 / / ’ t i t l e "
’ / / TRIM ( g r a p h _ t i t l e 2 ) / / ’ " , " x y d a t a 1 . d a t " u s i n g 2 : 5 : x t i c l a b e l s ( 1 ) w i t h ’ / / L a y o u t 3 / / ’ t i t l e
" ’ / / TRIM ( g r a p h _ t i t l e 3 ) / / ’ " , " x y d a t a 1 . d a t " u s i n g 2 : 6 : x t i c l a b e l s ( 1 ) w i t h ’ / / L a y o u t 4 / / ’
t i t l e " ’ / / TRIM ( g r a p h _ t i t l e 4 ) / / ’ " , " x y d a t a 1 . d a t " u s i n g 2 : 7 : x t i c l a b e l s ( 1 ) w i t h ’ / / L a y o u t 5 / /
’ t i t l e " ’ / / TRIM ( g r a p h _ t i t l e 5 ) / / ’ " , " x y d a t a 1 . d a t " u s i n g 2 : 8 : x t i c l a b e l s ( 1 ) w i t h ’ / / L a y o u t 6
/ / ’ t i t l e " ’ / / TRIM ( g r a p h _ t i t l e 6 ) / / ’ " , " x y d a t a 1 . d a t " u s i n g 2 : 9 : x t i c l a b e l s ( 1 ) w i t h ’ / /
L a y o u t 7 / / ’ t i t l e " ’ / / TRIM ( g r a p h _ t i t l e 7 ) / / ’ " , " x y d a t a 1 . d a t " u s i n g 2 : 1 0 : x t i c l a b e l s ( 1 ) w i t h
’ / / L a y o u t 8 / / ’ t i t l e " ’ / / TRIM ( g r a p h _ t i t l e 8 ) / / ’ " , " x y d a t a 1 . d a t " u s i n g 2 : 1 1 : x t i c l a b e l s ( 1 )
w i t h ’ / / L a y o u t 9 / / ’ t i t l e " ’ / / TRIM ( g r a p h _ t i t l e 9 ) / / ’ " , " x y d a t a 1 . d a t " u s i n g 2 : 1 2 : x t i c l a b e l s
( 1 ) w i t h ’ / / L a y o u t 1 0 / / ’ t i t l e " ’ / / TRIM ( g r a p h _ t i t l e 1 0 ) / / ’ " ’
1130
1131 CLOSE ( 1 0 , STATUS= ’KEEP ’ )
1132
1133 ! P l o t c u r v e w i t h g n u p l o t and c l e a n u p f i l e s
1134 ! −−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−
1135 C a l l SYSTEM( ’ g n u p l o t gp . t x t ’ )
1136
1137 ! Pause ! To c h e c k t h e gnu f i l e b e f o r e d e l e t i o n i f t h e g r a p h i s n o t a s e x p e c t e d
.
1138
1139 C a l l SYSTEM( ’ d e l gp . t x t ’ )
1140 C a l l SYSTEM( ’ d e l x y d a t a 1 . d a t ’ )
248 F. Code of the MarsdiepVisual Program
1141
1142 ! Check m e s s a g e
1143 ! −−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−
1144 W r i t e ( * , ’ (A) ’ ) ’ F i l e ’ / / ’ " ’ / / ’ P l o t ’ / / t r i m ( T i t l e ) / / ’ . png ’ / / ’ " ’ / / ’ i s c r e a t e d . ’
1145
1146 End S u b r o u t i n e
1147
1148 ! −−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−
1149
1150 Subroutine f2gpSamplePar ( Location , xdata , ydata1 , s t y l e 1 , ydata2 , s t y l e 2 , t i t l e , xlabel , ylabel1 ,
ylabel2 , graph_title1 , g r a p h _ t i t l e 2 )
1151 ! P l o t s two s a m p l e p a r a m e t e r s i n one g r a p h w i t h d i f f e r e n t y − a x i s .
1152 I m p l i c i t None
1153
1154 Character (10) :: Location
1155 Character (*) :: xdata ( : )
1156 Real :: ydata1 ( : ) , ydata2 ( : )
1157 C h a r a c t e r ( l e n =* ) :: xlabel , ylabel1 , ylabel2 , t i t l e
1158 Character (*) :: graph_title1 , graph_title2
1159 Character (2) :: style1 , style2
1160 Character (25) :: Layout1 , L a y o u t 2
1161 Integer :: i , n1
1162
1163 n1 = size ( xdata )
1164
1165 ! −−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−
1166 ! Write data in f i l e s
1167 ! −−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−
1168 OPEN( 1 0 , A c c e s s = ’SEQUENTIAL ’ , F i l e = ’ x y d a t a 1 . d a t ’ )
1169
1170 Do i = 1 , n1
1171 I f ( y d a t a 1 ( i ) == 0 . o r . y d a t a 2 ( i ) == 0 ) Then
1172 Write (10 , * )
1173 Else
1174 W r i t e ( 1 0 , ’ (A, 1 x , I , 1 x , F6 . 3 , 1 x , F6 . 2 ) ’ ) x d a t a ( i ) , i , y d a t a 1 ( i ) , y d a t a 2 ( i )
1175 End I f
1176 End Do
1177
1178 CLOSE ( 1 0 , S t a t u s = ’KEEP ’ )
1179
1180 ! C r e a t e g n u p l o t command f i l e
1181 ! −−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−
1182 OPEN( 1 0 , ACCESS= ’SEQUENTIAL ’ , FILE= ’ gp . t x t ’ )
1183 W r i t e ( 1 0 , ’ (A) ’ ) ’ s e t t e r m i n a l png s i z e 2 4 0 0 , 8 0 0 ’ ! Sets i t to create
. png
1184 W r i t e ( 1 0 , ’ (A) ’ ) ’ s e t o u t p u t ’ / / ’ " ’ / / ’D : / h i j n e k a m / D e s k t o p / Program / G r a p h s / P l o t ’ / / t r i m ( t i t l e ) / /
’ . png ’ / / ’ " ’ ! C r e a t e s . png f i l e and s t o r e s i t i n a d i f f e r e n t f o l d e r . The " / "
u s e d i s d i f f e r e n t from t h e d e f a u l t o r f o r t r a n ( " \ " ) ! ! !
1185 W r i t e ( 1 0 , ’ (A) ’ ) ’ s e t t i t l e ’ / / ’ " { / : Bold ’ / / T i t l e / / ’ } " ’ ! Graph T i t l e ,
t i t l e i n b o l d , works
1186 W r i t e ( 1 0 , ’ (A) ’ ) ’ s e t x l a b e l ’ / / ’ " ’ / / Trim ( x l a b e l ) / / ’ " ’
1187 W r i t e ( 1 0 , ’ (A) ’ ) ’ s e t y l a b e l ’ / / ’ " ’ / / Trim ( y l a b e l 1 ) / / ’ " ’
1188 W r i t e ( 1 0 , ’ (A) ’ ) ’ s e t y 2 l a b e l ’ / / ’ " ’ / / TRIM ( y l a b e l 2 ) / / ’ " ’
1189 W r i t e ( 1 0 , ’ (A) ’ ) ’ s e t key L e f t r i g h t o u t s i d e ’
1190 W r i t e ( 1 0 , ’ (A) ’ ) ’ s e t x t i c s r o t a t e by −45 ’
1191 W r i t e ( 1 0 , ’ (A) ’ ) ’ s e t g r i d ’ ! show g r i d l i n e s i n t h e xy p l a n e
1192
1193 S e l e c t Case ( t i t l e ) ! F i x e s t h e a x i s s o t h a t t h e g r i d i s c o r r e c t on b o t h a x i s , t h i s o f
c o u r s e c a n o n l y be done f o r known c a s e s .
1194
1195 Case ( ’DH D e n s i t y vs . Sand C o n t e n t ’ )
1196 Write (10 , * ) ’ set ytics 0 ,0.3 ,1.5 ’
1197 Write (10 , * ) ’ set y2tics 0 ,0.05 ,0.25 ’
1198 Write (10 , * ) ’ set yrange [ 0 : 1 . 5 ] ’
1199 Write (10 , * ) ’ set y2range [ 0 : 0 . 2 5 ] ’
1200
1201 Case ( ’T D e n s i t y v s . Sand C o n t e n t ’ )
1202 Write (10 , * ) ’ set ytics 0 ,0.3 ,1.5 ’
1203 Write (10 , * ) ’ set y2tics 0 ,0.02 ,0.1 ’
1204 Write (10 , * ) ’ s e t yrange [ 0 : 1 . 5 ] ’
1205 Write (10 , * ) ’ s e t y2range [ 0 : 0 . 1 ] ’
249
1206
1207 Case ( ’DH T e m p e r a t u r e v s . Marsh F u n n e l ’ )
1208 Write (10 , * ) ’ s e t ytics 0 ,5 ,25 ’
1209 Write (10 , * ) ’ s e t y 2 t i c s 0 ,40 ,200 ’
1210 Write (10 , * ) ’ s e t yrange [ 0 : 2 5 ] ’
1211 Write (10 , * ) ’ s e t y2range [0:200] ’
1212
1213 Case ( ’T T e m p e r a t u r e v s . Marsh F u n n e l ’ )
1214 Write (10 , * ) ’ s e t y t i c s 0 ,5 ,30 ’
1215 Write (10 , * ) ’ s e t y 2 t i c s 0 ,20 ,120 ’
1216 Write (10 , * ) ’ s e t yrange [ 0 : 3 0 ] ’
1217 Write (10 , * ) ’ s e t y2range [ 0 : 1 2 0 ] ’
1218
1219 Case D e f a u l t
1220 Write (10 , * ) ’ s e t y t i c s ’
1221 Write (10 , * ) ’ s e t y 2 t i c s ’
1222 Write (10 , * ) ’ s e t yrange [ 0 : * ] ’ ! F o r c e s t h e minimum o f t h e y − a x i s t o be 0
while the upperlimit i s s t i l l f l e x i b l e .
1223 Write (10 , * ) ’ s e t y2range [ 0 : * ] ’
1224 W r i t e ( * , ’ (A) ’ ) ’ Graph i s n o t s p e c i f i e d , t h e t i c s on t h e a x e s and i t s v a l u e s c a n l o o k
weird but are c o r r e c t . ’
1225 End S e l e c t
1226
1227 C a l l GraphStyle ( Style1 , Layout1 )
1228 C a l l GraphStyle ( Style2 , Layout2 )
1229
1230 W r i t e ( 1 0 , ’ (A) ’ ) ’ p l o t " x y d a t a 1 . d a t " u s i n g 2 : 3 : x t i c l a b e l s ( 1 ) w i t h ’ / / t r i m ( L a y o u t 1 ) / / ’ a x e s
x1y1 t i t l e " ’ / / TRIM ( g r a p h _ t i t l e 1 ) / / ’ " , " x y d a t a 1 . d a t " u s i n g 2 : 4 : x t i c l a b e l s ( 1 ) w i t h ’ / / t r i m (
L a y o u t 2 ) / / ’ a x e s x1y2 t i t l e " ’ / / TRIM ( g r a p h _ t i t l e 2 ) / / ’ " ’
1231
1232 CLOSE ( 1 0 , STATUS= ’KEEP ’ )
1233
1234 ! P l o t c u r v e w i t h g n u p l o t and c l e a n u p f i l e s
1235 ! −−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−
1236 C a l l SYSTEM( ’ g n u p l o t gp . t x t ’ )
1237
1238 ! Pause ! To c h e c k t h e gnu f i l e b e f o r e d e l e t i o n i f t h e g r a p h i s n o t a s e x p e c t e d
.
1239
1240 C a l l SYSTEM( ’ d e l gp . t x t ’ )
1241 C a l l SYSTEM( ’ d e l x y d a t a 1 . d a t ’ )
1242
1243 ! Check m e s s a g e
1244 ! −−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−
1245 W r i t e ( * , ’ (A) ’ ) ’ F i l e ’ / / ’ " P l o t ’ / / t r i m ( T i t l e ) / / ’ . png ’ / / ’ " ’ / / ’ i s c r e a t e d . ’
1246
1247 End S u b r o u t i n e
1248
1249 ! −−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−
1250
1251 S u b r o u t i n e f2gpwBG ( wdata1 , x d a t a 1 , y d a t a 1 , S t y l e 1 , wdata2 , x d a t a 2 , y d a t a 2 , S t y l e 2 , t i t l e , x l a b e l ,
ylabel , graphtitle1 , g r a p h t i t l e 2 )
1252 ! I m p l e m e n t a p i c t u r e f o r t h e b a c k g r o u n d . Based on a m o n g s t o t h e r s ; h t t p : / / www. g n u p l o t t i n g .
o r g / t a g / image / .
1253 ! And p l o t s r e s u l t s o f t h e Sample S o u r c e p r o g r a m on t o p o f i t .
1254 I m p l i c i t None
1255
1256 Character (*) :: wdata1 ( : ) , wdata2 ( : )
1257 Real :: xdata1 ( : ) , ydata1 ( : ) , xdata2 ( : ) , ydata2 ( : )
1258 Character (2) :: Style1 , Style2
1259 Character (25) :: Layout1 , L a y o u t 2
1260 Integer :: i , n1 , n2
1261 Character (50) :: title
1262 C h a r a c t e r ( l e n =* ) :: xlabel , ylabel , graphtitle1 , g r a p h t i t l e 2
1263
1264 n1 = size ( xdata1 )
1265 n2 = size ( xdata2 )
1266
1267 write ( * ,* ) xdata1
1268
1269 ! −−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−
250 F. Code of the MarsdiepVisual Program
1331 ! −−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−
1332 C a l l SYSTEM( ’ g n u p l o t gp . t x t ’ )
1333
1334 ! Pause ! To c h e c k t h e gnu f i l e b e f o r e d e l e t i o n i f t h e g r a p h i s n o t a s e x p e c t e d .
1335
1336 C a l l SYSTEM( ’ d e l gp . t x t ’ )
1337 C a l l SYSTEM( ’ d e l x y d a t a 1 . d a t ’ )
1338 C a l l SYSTEM( ’ d e l x y d a t a 2 . d a t ’ )
1339
1340 ! Check m e s s a g e
1341 ! −−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−
1342 W r i t e ( * , ’ (A) ’ ) ’ F i l e ’ / / ’ " ’ / / ’ P l o t ’ / / t r i m ( t i t l e ) / / ’ . png ’ / / ’ " ’ / / ’ i s c r e a t e d . ’
1343
1344 End S u b r o u t i n e
1345
1346 ! −−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−
1347
1348 S u b r o u t i n e f2gpwBG2 ( G r a p h O p t i o n , f i l e n a m e , wdata1 , x d a t a 1 , y d a t a 1 , S t y l e 1 , x d a t a 3 , y d a t a 3 , s t y l e 3 ,
wdata2 , x d a t a 2 , y d a t a 2 , S t y l e 2 , x d a t a 4 , y d a t a 4 , s t y l e 4 , t i t l e , x l a b e l , y l a b e l , g r a p h t i t l e 1 ,
graphtitle2 , graphtitle3 , graphtitle4 )
1349 ! I m p l e m e n t a p i c t u r e f o r t h e b a c k g r o u n d . Based on a m o n g s t o t h e r s ; h t t p : / / www. g n u p l o t t i n g .
o r g / t a g / image / .
1350 ! And p l o t s r e s u l t s o f t h e Sample S o u r c e p r o g r a m on t o p o f i t .
1351 I m p l i c i t None
1352
1353 Character (*) :: wdata1 ( : ) , wdata2 ( : )
1354 Real :: xdata1 ( : ) , ydata1 ( : ) , xdata2 ( : ) , ydata2 ( : )
1355 Real ( 8 ) :: xdata3 ( : ) , ydata3 ( : ) , xdata4 ( : ) , ydata4 ( : )
1356 Character (2) :: Style1 , Style2
1357 Character (2) :: Style3 , Style4
1358 Character (25) :: Layout1 , L a y o u t 2
1359 Character (25) :: Layout3 , L a y o u t 4
1360 Integer :: i , n1 , n2 , n3 , n4
1361 Character (50) :: title
1362 Character (50) :: filename
1363 C h a r a c t e r ( l e n =* ) :: xlabel , ylabel , graphtitle1 , graphtitle2 , graphtitle3 , g r a p h t i t l e 4
1364 Integer :: GraphOption
1365
1366 n1 = size ( xdata1 )
1367 n2 = size ( xdata2 )
1368 n3 = size ( xdata3 )
1369 n4 = size ( xdata4 )
1370
1371 ! −−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−
1372 ! Write data in f i l e s
1373 ! −−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−
1374 OPEN( 1 0 , A c c e s s = ’SEQUENTIAL ’ , F i l e = ’ x y d a t a 1 . d a t ’ )
1375
1376 Do i = 1 , n1
1377 W r i t e ( 1 0 , ’ (A, 1 x , F7 . 2 , 1 x , F7 . 2 ) ’ ) w d a t a 1 ( i ) ,100+ x d a t a 1 ( i ) , y d a t a 1 ( i ) ! The 100 i s
because the i n p u t d a t a in t h i s case i s r e l a t i v e to the origin , the o r i g i n i s a t approx .
100m.
1378 End Do
1379
1380 CLOSE ( 1 0 , S t a t u s = ’KEEP ’ )
1381
1382 ! −−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−
1383 OPEN( 1 0 , A c c e s s = ’SEQUENTIAL ’ , F i l e = ’ x y d a t a 2 . d a t ’ )
1384
1385 Do i = 1 , n2
1386 W r i t e ( 1 0 , ’ (A, 1 x , F7 . 2 , 1 x , F7 . 2 ) ’ ) w d a t a 2 ( i ) ,4675 − x d a t a 2 ( i ) , y d a t a 2 ( i ) ! The 4675 i s
because the i n p u t data in t h i s case i s r e l a t i v e to the origin , the o r i g i n i s a t approx .
4675m.
1387 End Do
1388
1389 CLOSE ( 1 0 , S t a t u s = ’KEEP ’ )
1390
1391 ! −−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−
1392 OPEN( 1 0 , A c c e s s = ’SEQUENTIAL ’ , F i l e = ’ x y d a t a 3 . d a t ’ )
1393
1394 W r i t e ( 1 0 , ’ ( F7 . 2 , 1 x , F7 . 2 ) ’ ) 100+ x d a t a 3 ( 1 ) , y d a t a 3 ( 1 )
252 F. Code of the MarsdiepVisual Program
1395
1396 Do i = 2 , n3
1397 I f ( x d a t a 3 ( i ) < x d a t a 3 ( i − 1) ) W r i t e ( 1 0 , * )
1398 W r i t e ( 1 0 , ’ ( F7 . 2 , 1 x , F7 . 2 ) ’ ) 100+ x d a t a 3 ( i ) , y d a t a 3 ( i ) ! The 100 i s b e c a u s e t h e i n p u t
d a t a i n t h i s c a s e i s r e l a t i v e t o t h e o r i g i n , t h e o r i g i n i s a t a p p r o x . 100m.
1399 End Do
1400
1401 CLOSE ( 1 0 , S t a t u s = ’KEEP ’ )
1402
1403 ! −−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−
1404 OPEN( 1 0 , A c c e s s = ’SEQUENTIAL ’ , F i l e = ’ x y d a t a 4 . d a t ’ )
1405
1406 Do i = 1 , n4
1407 I f ( x d a t a 4 ( i ) < x d a t a 4 ( i − 1) ) W r i t e ( 1 0 , * )
1408 W r i t e ( 1 0 , ’ ( F7 . 2 , 1 x , F7 . 2 ) ’ ) 4675 − x d a t a 4 ( i ) , y d a t a 4 ( i ) ! The 4675 i s b e c a u s e t h e
i n p u t d a t a i n t h i s c a s e i s r e l a t i v e t o t h e o r i g i n , t h e o r i g i n i s a t a p p r o x . 4675m.
1409 End Do
1410
1411 CLOSE ( 1 0 , S t a t u s = ’KEEP ’ )
1412
1413 ! C r e a t e g n u p l o t command f i l e
1414 ! −−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−
1415 OPEN( 1 0 , ACCESS= ’SEQUENTIAL ’ , FILE= ’ gp . t x t ’ )
1416 W r i t e ( 1 0 , ’ (A) ’ ) ’ s e t t e r m i n a l p n g c a i r o s i z e 4 8 0 0 , 2 4 0 0 ’ ! linewidth 2.0 font " ,40"
s i z e 2000 ,1000 ’
1417 W r i t e ( 1 0 , ’ (A) ’ ) ’ s e t o u t p u t ’ / / ’ " ’ / / ’D : / h i j n e k a m / D e s k t o p / Program / G r a p h s / P l o t _ ’ / / t r i m ( f i l e n a m e
) / / ’ . png ’ / / ’ " ’
1418 W r i t e ( 1 0 , ’ (A) ’ ) ’ s e t t i t l e " ’ / / t r i m ( t i t l e ) / / ’ " f o n t " , 3 2 " ’
1419
1420 W r i t e ( 1 0 , ’ (A) ’ ) ’ s e t s i z e 0 . 9 ’
1421 W r i t e ( 1 0 , ’ (A) ’ ) ’ s e t o r i g i n 0 . 0 5 , 0 . 0 5 ’
1422 W r i t e ( 1 0 , ’ (A) ’ ) ’ s e t x r a n g e [ − 650 : 6110 ] ’ ! Found m a n u a l l y b a s e d on
t h e p i c t u r e used , s i n c e i t a l r e a d y c o n t a i n s a s c a l e . . .
1423 W r i t e ( 1 0 , ’ (A) ’ ) ’ s e t x l a b e l ’ / / ’ " ’ / / Trim ( x l a b e l ) / / ’ " f o n t " , 2 8 " ’
1424 W r i t e ( 1 0 , ’ (A) ’ ) ’ s e t x t i c s 0 , 5 0 0 , 5 0 0 0 o u t n o m i r r o r r o t a t e by −45 ’ ! the values are
OVERWRITTEN due t o u s e o f s a m p l e names on x − a x i s , t h e o t h e r o p t i o n s s t i l l work .
1425 W r i t e ( 1 0 , ’ (A) ’ ) ’ s e t y r a n g e [ − 153.5 : 32 ] ’ ! Idem d i t o . . .
1426 W r i t e ( 1 0 , ’ (A) ’ ) ’ u n s e t y t i c s ’
1427 ! W r i t e ( 1 0 , ’ (A) ’ ) ’ s e t y t i c s − 150 ,50 ,50 o u t n o m i r r o r f o n t " , 2 2 " ’ ! R e p l a c e s by a r r o w s s i n c e
t h e h o r i z o n t a l g r i d l i n e s went i n t o t h e key a t t h e s i d e .
1428
1429 W r i t e ( 1 0 , * ) ’ s e t y l a b e l ’ / / ’ " ’ / / Trim ( y l a b e l ) / / ’ " f o n t " , 2 8 " o f f s e t − 4 ,0 ’
1430
1431 W r i t e ( 1 0 , ’ (A) ’ ) ’ s e t g r i d f r o n t lw 3 ’
1432 W r i t e ( 1 0 , ’ (A) ’ ) ’ s e t key a t 6100 , − 135 L e f t r e v e r s e f o n t " , 2 4 " ’
1433
1434 Write (10 , ’ (A) ’) ’ s e t x2range [ 0 : * ] ’ ! noreverse nowriteback ’
1435 Write (10 , ’ (A) ’) ’ s e t y2range [ 0 : * ] ’ ! noreverse nowriteback ’
1436 Write (10 , ’ (A) ’) ’ unset x2tics ’
1437 Write (10 , ’ (A) ’) ’ unset y2tics ’
1438
1439 Call GraphStyle ( Style1 , Layout1 )
1440 Call GraphStyle ( Style2 , Layout2 )
1441 Call GraphStyle ( Style3 , Layout3 )
1442 Call GraphStyle ( Style4 , Layout4 )
1443
1444 W r i t e ( 1 0 , ’ (A) ’ ) ’ set lmargin at screen 0.05 ’
1445 ! W r i t e ( 1 0 , ’ (A) ’ ) ’ s e t rmargin at screen 0.85 ’
1446 W r i t e ( 1 0 , ’ (A) ’ ) ’ s e t bmargin a t screen 0.05 ’
1447 W r i t e ( 1 0 , ’ (A) ’ ) ’ set tmargin at screen 0.95 ’
1448
1449 S e l e c t Case ( G r a p h O p t i o n )
1450
1451 Case ( 1 ) ! Head L o c a t i o n s a m p l i n g t i m e
1452 W r i t e ( 1 0 , ’ (A) ’ ) ’ p l o t " C r o s s s e c t i o n . png " b i n a r y f i l e t y p e =png u s i n g 1 : 2 : 3 : ( 2 2 5 ) w i t h
r g b a l p h a n o t i t l e a x e s x2y2 , " x y d a t a 1 . d a t " u s i n g 2 : 3 : x t i c l a b e l s ( 1 ) w i t h ’ / / t r i m ( L a y o u t 1 ) / /
’ a x e s x1y1 t i t l e " ’ / / TRIM ( g r a p h t i t l e 1 ) / / ’ " , " x y d a t a 2 . d a t " u s i n g 2 : 3 : x t i c l a b e l s ( 1 ) w i t h ’
/ / t r i m ( L a y o u t 2 ) / / ’ a x e s x1y1 t i t l e " ’ / / TRIM ( g r a p h t i t l e 2 ) / / ’ " ’
1453 ! The v a l u e b e t w e e n b r a c k e t s i n t h e 1 : 2 : 3 : ( X) p a r t n e e d s t o be b e t w e e n 0 ( f u l l y
t r a n s p a r a n t ) and 255 ( f u l l y o p a q u e ) .
1454
253
1508 ! −−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−
1509 OPEN( 1 0 , A c c e s s = ’SEQUENTIAL ’ , F i l e = ’ x y d a t a 1 . d a t ’ )
1510
1511 I f ( ( s i z e (D) / 9 9 ) == 6 9 ) W r i t e ( 1 0 , ’ (A, 6 9 ( 1 x , A) ) ’ ) ’ Y d a t a ’ , Sample_Code ( : )
1512 I f ( ( s i z e (D) / 9 9 ) == 4 3 ) W r i t e ( 1 0 , ’ (A, 4 3 ( 1 x , A) ) ’ ) ’ Y d a t a ’ , Sample_Code ( : )
1513
1514 Do j = 1 , 99
1515 Write (10 , ’ ( I ,1 x , 9 8 ( F ,1 x ) ,F) ’ ) j , D( : , j )
1516 End Do
1517
1518 CLOSE ( 1 0 , S t a t u s = ’KEEP ’ )
1519
1520 ! C r e a t e g n u p l o t command f i l e
1521 ! −−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−
1522 OPEN( 1 0 , ACCESS= ’SEQUENTIAL ’ , FILE= ’ gp . t x t ’ )
1523 W r i t e ( 1 0 , ’ (A) ’ ) ’ s e t t e r m i n a l p n g c a i r o s i z e 2 4 0 0 , 2 4 0 0 ’ ! l i n e w i d t h 2 . 0 f o n t " , 4 0 " s i z e
2000 ,1000 ’
1524 W r i t e ( 1 0 , ’ (A) ’ ) ’ s e t o u t p u t ’ / / ’ " ’ / / ’D : / h i j n e k a m / D e s k t o p / Program / G r a p h s / S i e v e C u r v e s / ’ / / t r i m (
t i t l e ) / / ’ . png ’ / / ’ " ’
1525 W r i t e ( 1 0 , ’ (A) ’ ) ’ s e t t i t l e " ’ / / t r i m ( t i t l e ) / / ’ " f o n t " , 3 2 " ’
1526
1527 W r i t e ( 1 0 , ’ (A) ’ ) ’ s e t x r a n g e [ 0 . 0 0 1 : 10 ] ’ ! Found m a n u a l l y b a s e d on t h e p i c t u r e
used , s i n c e i t already contains a scale . . .
1528 W r i t e ( 1 0 , ’ (A) ’ ) ’ set xtics ’
1529 W r i t e ( 1 0 , ’ (A) ’ ) ’ set mxtics ’
1530 W r i t e ( 1 0 , ’ (A) ’ ) ’ s e t x l a b e l ’ / / ’ " ’ / / Trim ( x l a b e l ) / / ’ " f o n t " , 2 8 " ’
1531
1532 W r i t e ( 1 0 , ’ (A) ’ ) ’ s e t y r a n g e [ 0 : 100 ] ’ ! Idem d i t o . . .
1533 W r i t e ( 1 0 , ’ (A) ’ ) ’ s e t y t i c s 0 , 1 0 , 1 0 0 ’
1534 W r i t e ( 1 0 , ’ (A) ’ ) ’ s e t y l a b e l ’ / / ’ " ’ / / Trim ( y l a b e l ) / / ’ " f o n t " , 2 8 " o f f s e t − 4 ,0 ’
1535
1536 W r i t e ( 1 0 , ’ (A) ’ ) ’ s e t g r i d x t i c s m x t i c s y t i c s l c r g b " b l a c k " l t 1 lw 1 ’
1537
1538 W r i t e ( 1 0 , ’ (A) ’ ) ’ s e t key L e f t r e v e r s e f o n t " , 2 4 " ’
1539
1540 Write (10 , ’ (A) ’) ’ set tmargin at screen 0.95 ’
1541 Write (10 , ’ (A) ’) ’ set bmargin at screen 0.05 ’
1542 Write (10 , ’ (A) ’) ’ set rmargin at screen 0.95 ’
1543 Write (10 , ’ (A) ’) ’ set lmargin at screen 0.05 ’
1544
1545 C a l l G r a p h S t y l e ( S t y l e 1 , Layout1 , I n d e x 1 )
1546 I f ( P r e s e n t ( I n d e x 2 ) ) C a l l G r a p h S t y l e ( S t y l e 2 , Layout2 , I n d e x 2 )
1547 I f ( P r e s e n t ( I n d e x 3 ) ) C a l l G r a p h S t y l e ( S t y l e 3 , Layout3 , I n d e x 3 )
1548 I f ( P r e s e n t ( I n d e x 4 ) ) C a l l G r a p h S t y l e ( S t y l e 4 , Layout4 , I n d e x 4 )
1549 I f ( P r e s e n t ( I n d e x 5 ) ) C a l l G r a p h S t y l e ( S t y l e 5 , Layout5 , I n d e x 5 )
1550 I f ( P r e s e n t ( I n d e x 6 ) ) C a l l G r a p h S t y l e ( S t y l e 6 , Layout6 , I n d e x 6 )
1551 I f ( P r e s e n t ( I n d e x 7 ) ) C a l l G r a p h S t y l e ( S t y l e 7 , Layout7 , I n d e x 7 )
1552 I f ( P r e s e n t ( I n d e x 8 ) ) C a l l G r a p h S t y l e ( S t y l e 8 , Layout8 , I n d e x 8 )
1553 I f ( P r e s e n t ( I n d e x 9 ) ) C a l l G r a p h S t y l e ( S t y l e 9 , Layout9 , I n d e x 9 )
1554 I f ( P r e s e n t ( I n d e x 1 0 ) ) C a l l G r a p h S t y l e ( S t y l e 1 0 , Layout10 , I n d e x 1 0 )
1555 I f ( P r e s e n t ( I n d e x 1 1 ) ) C a l l G r a p h S t y l e ( S t y l e 1 1 , Layout11 , I n d e x 1 1 )
1556 I f ( P r e s e n t ( I n d e x 1 2 ) ) C a l l G r a p h S t y l e ( S t y l e 1 2 , Layout12 , I n d e x 1 2 )
1557 I f ( P r e s e n t ( I n d e x 1 3 ) ) C a l l G r a p h S t y l e ( S t y l e 1 3 , Layout13 , I n d e x 1 3 )
1558 I f ( P r e s e n t ( I n d e x 1 4 ) ) C a l l G r a p h S t y l e ( S t y l e 1 4 , Layout14 , I n d e x 1 4 )
1559 I f ( P r e s e n t ( I n d e x 1 5 ) ) C a l l G r a p h S t y l e ( S t y l e 1 5 , Layout15 , I n d e x 1 5 )
1560 I f ( P r e s e n t ( I n d e x 1 6 ) ) C a l l G r a p h S t y l e ( S t y l e 1 6 , Layout16 , I n d e x 1 6 )
1561
1562 Write (10 , * ) ’ s e t log x ’
1563
1564 I f ( P r e s e n t ( I n d e x 1 6 ) ) Then
1565 W r i t e ( 1 0 , ’ (A, 1 6 ( I3 , A) ) ’ ) ’ p l o t f o r [ n i n " ’ , I n d e x 1 , ’ ’ , I n d e x 2 , ’ ’ , I n d e x 3 , ’ ’ , I n d e x 4 , ’ ’ ,
Index5 , ’ ’ , Index6 , ’ ’ , Index7 , ’ ’ , Index8 , ’ ’ , Index9 , ’ ’ , Index10 , ’ ’ , Index11 , ’ ’ , Index12 , ’
’ , I n d e x 1 3 , ’ ’ , I n d e x 1 4 , ’ ’ , I n d e x 1 5 , ’ ’ , I n d e x 1 6 , ’ " ] " x y d a t a 1 . d a t " u s i n g ( column ( n + 1 ) ) : 1
with l i n e s l s ( n ) t i t l e columnheader ( n +1) ’
1566 E l s e I f ( P r e s e n t ( I n d e x 1 5 ) ) Then
1567 W r i t e ( 1 0 , ’ (A, 1 5 ( I3 , A) ) ’ ) ’ p l o t f o r [ n i n " ’ , I n d e x 1 , ’ ’ , I n d e x 2 , ’ ’ , I n d e x 3 , ’ ’ , I n d e x 4 , ’ ’ ,
Index5 , ’ ’ , Index6 , ’ ’ , Index7 , ’ ’ , Index8 , ’ ’ , Index9 , ’ ’ , Index10 , ’ ’ , Index11 , ’ ’ , Index12 , ’
’ , I n d e x 1 3 , ’ ’ , I n d e x 1 4 , ’ ’ , I n d e x 1 5 , ’ " ] " x y d a t a 1 . d a t " u s i n g ( column ( n + 1 ) ) : 1 w i t h l i n e s l s (
n ) t i t l e columnheader ( n +1) ’
1568 E l s e I f ( P r e s e n t ( I n d e x 1 4 ) ) Then
1569 W r i t e ( 1 0 , ’ (A, 1 4 ( I3 , A) ) ’ ) ’ p l o t f o r [ n i n " ’ , I n d e x 1 , ’ ’ , I n d e x 2 , ’ ’ , I n d e x 3 , ’ ’ , I n d e x 4 , ’ ’ ,
255
1616
1617 S u b r o u t i n e f 2 g p S i e v e 2 ( t i t l e , x l a b e l , y l a b e l , Sample_Code , D, Sample_Code_V , D_V , I n d e x 1 , s t y l e 1 ,
Index2 , s t y l e 2 , Index3 , s t y l e 3 , Index4 , s t y l e 4 , Index5 , s t y l e 5 , Index6 , s t y l e 6 , Index7 , s t y l e 7 ,
Index8 , s t y l e 8 , Index9 , s t y l e 9 )
1618 ! P l o t s d i f f e r e n t s a n d c u r v e s , up t o 5 i n t h e same g r a p h .
1619 I m p l i c i t None
1620
1621 Character (*) :: title
1622 Character (*) :: xlabel , ylabel
1623 Character (14) : : Sample_Code ( : ) , Sample_Code_V ( : )
1624 Integer :: Index1 , Index2
1625 Integer , Optional :: Index3 , Index4 , Index5 , Index6 , Index7 , Index8 , Index9 !
O p t i o n a l o n l y works f o r u n i t s t h a t a r e c a l l e d o r e x p o r t e d , i n t e r n a l u n i t s a r e d e f i n e d i n
any c a s e . i . e . l a y o u t i s i n t e r n a l and t h u s l a c k s t h e o p t i o n a l a r g u m e n t .
1626 Character (2) :: Style1 , Style2
1627 Character (2) , Optional :: Style3 , Style4 , Style5 , Style6 , Style7 , Style8 , Style9
1628 Character (25) :: Layout1
1629 Character (25) :: Layout2 , Layout3 , Layout4 , Layout5 , Layout6 , Layout7 , Layout8 ,
Layout9
1630 Real : : D( : , : )
1631 Real : : D_V ( : , : )
1632 Integer :: i, j
1633
1634 ! −−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−
1635 ! Write data in f i l e s
1636 ! −−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−
1637 OPEN( 1 0 , A c c e s s = ’SEQUENTIAL ’ , F i l e = ’ x y d a t a 1 . d a t ’ )
1638
1639 I f ( ( s i z e (D) / 9 9 ) == 6 9 ) W r i t e ( 1 0 , ’ (A, 6 9 ( 1 x , A) ) ’ ) ’ Y d a t a ’ , Sample_Code ( : )
1640
1641 Do j = 1 , 99
1642 Write (10 , ’ ( I ,1 x , 9 8 ( F ,1 x ) ,F) ’ ) j , D( : , j )
1643 End Do
1644
1645 CLOSE ( 1 0 , S t a t u s = ’KEEP ’ )
1646
1647 ! −−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−
1648
1649 OPEN( 1 0 , A c c e s s = ’SEQUENTIAL ’ , F i l e = ’ x y d a t a 2 . d a t ’ )
1650
1651 W r i t e ( 1 0 , ’ (A, 4 3 ( 1 x , A) ) ’ ) ’ Y d a t a ’ , Sample_Code_V ( : )
1652
1653 Do j = 1 , 99
1654 W r i t e ( 1 0 , ’ ( I , 1 x , 9 8 ( F , 1 x ) , F ) ’ ) j , D_V ( : , j )
1655 End Do
1656
1657 CLOSE ( 1 0 , S t a t u s = ’KEEP ’ )
1658
1659 ! C r e a t e g n u p l o t command f i l e
1660 ! −−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−
1661 OPEN( 1 0 , ACCESS= ’SEQUENTIAL ’ , FILE= ’ gp . t x t ’ )
1662 W r i t e ( 1 0 , ’ (A) ’ ) ’ s e t t e r m i n a l p n g c a i r o s i z e 2 4 0 0 , 2 4 0 0 ’ ! l i n e w i d t h 2 . 0 f o n t " , 4 0 " s i z e
2000 ,1000 ’
1663 W r i t e ( 1 0 , ’ (A) ’ ) ’ s e t o u t p u t ’ / / ’ " ’ / / ’D : / h i j n e k a m / D e s k t o p / Program / G r a p h s / S i e v e C u r v e s / P l o t ’ / /
t r i m ( t i t l e ) / / ’ . png ’ / / ’ " ’
1664 W r i t e ( 1 0 , ’ (A) ’ ) ’ s e t t i t l e " ’ / / t r i m ( t i t l e ) / / ’ " f o n t " , 3 2 " ’
1665
1666 W r i t e ( 1 0 , ’ (A) ’ ) ’ s e t x r a n g e [ 0 . 0 0 1 : 10 ] ’ ! Found m a n u a l l y b a s e d on t h e p i c t u r e
used , s i n c e i t already contains a scale . . .
1667 W r i t e ( 1 0 , ’ (A) ’ ) ’ set xtics ’
1668 W r i t e ( 1 0 , ’ (A) ’ ) ’ set mxtics ’
1669 Write (10 , * ) ’ s e t x l a b e l ’ / / ’ " ’ / / Trim ( x l a b e l ) / / ’ " f o n t " , 2 8 " ’
1670
1671 W r i t e ( 1 0 , ’ (A) ’ ) ’ s e t y r a n g e [ 0 : 100 ] ’ ! Idem d i t o . . .
1672 W r i t e ( 1 0 , ’ (A) ’ ) ’ s e t y t i c s 0 , 1 0 , 1 0 0 ’
1673
1674 W r i t e ( 1 0 , * ) ’ s e t y l a b e l ’ / / ’ " ’ / / Trim ( y l a b e l ) / / ’ " f o n t " , 2 8 " o f f s e t − 4 ,0 ’
1675
1676 W r i t e ( 1 0 , ’ (A) ’ ) ’ s e t g r i d x t i c s m x t i c s y t i c s l c r g b " b l a c k " l t 1 lw 1 ’
1677 W r i t e ( 1 0 , ’ (A) ’ ) ’ s e t key L e f t r e v e r s e f o n t " , 2 4 " ’
1678
257
1736
1737 Character (*) , Parameter :: filefolder_out = "D : \ h i j n e k a m \ D e s k t o p \ Program \
ProgramOutput \ " ! Outputfiles
1738 Integer : : Temp=21
1739 Integer : : Y, n0 , i
1740 Character (*) : : ID ! Sample ID . , u s e d
f o r t i t l e o f g r a p h and g r a p h f i l e n a m e .
1741 Character (2) :: style1 , style2 , style3 , style4 , style5 , style6 , style7 ,
style8 , style9 , style0
1742 C h a r a c t e r ( l e n =* ) :: xlabel , ylabel
1743 C h a r a c t e r ( l e n =* ) :: title
1744 Character (11) :: g_title1 , g_title2 , g_title3 , g_title4 , g_title5 , g_title6 ,
g_title7 , g_title8 , g_title9 , g_title0
1745 Character (25) :: Layout1 , Layout2 , Layout3 , Layout4 , Layout5 , Layout6 , Layout7
, Layout8 , Layout9 , L a y o u t 0
1746 Character (150) :: Filename1 , Filename2 , Filename3 , Filename4 , Filename5 , Filename6 ,
Filename7 , Filename8 , Filename9 , Filename0
1747 Character (19) :: DateTimeSource
1748 C h a r a c t e r ( 1 9 ) , A l l o c a t a b l e : : Var ( : )
1749 Character (19) : : DateTimeMin
1750 Character (19) : : DateTimeMax
1751
1752 W r i t e ( F i l e n a m e 0 , ’ (A, A, A, I 2 . 2 ,A) ’ ) ’D : / h i j n e k a m / D e s k t o p / Program / P r o g r a m O u t p u t / S c e n a r i o s /’,
t r i m ( ID ) , ’ Away S c e n a r i o 0 1 . t x t ’ ! T h i s i s t h e same f o r a l l s c e n a r i o s f o r one
s a m p l e s s i n c e i t d e p e n d s on t h e s a m p l i n g t i m e which i s c o n s t a n t .
1753 W r i t e ( F i l e n a m e 1 , ’ (A, A, A, I 2 . 2 ,A) ’ ) ’D : / h i j n e k a m / D e s k t o p / Program / P r o g r a m O u t p u t / S c e n a r i o s /’,
t r i m ( ID ) , ’ PumpedVol S c e n a r i o 0 1 . txt ’
1754 W r i t e ( F i l e n a m e 2 , ’ (A, A, A, I 2 . 2 ,A) ’ ) ’D : / h i j n e k a m / D e s k t o p / Program / P r o g r a m O u t p u t / S c e n a r i o s /’,
t r i m ( ID ) , ’ PumpedVol S c e n a r i o 0 2 . txt ’
1755 W r i t e ( F i l e n a m e 3 , ’ (A, A, A, I 2 . 2 ,A) ’ ) ’D : / h i j n e k a m / D e s k t o p / Program / P r o g r a m O u t p u t / S c e n a r i o s /’,
t r i m ( ID ) , ’ PumpedVol S c e n a r i o 0 3 . txt ’
1756 W r i t e ( F i l e n a m e 4 , ’ (A, A, A, I 2 . 2 ,A) ’ ) ’D : / h i j n e k a m / D e s k t o p / Program / P r o g r a m O u t p u t / S c e n a r i o s /’,
t r i m ( ID ) , ’ PumpedVol S c e n a r i o 0 4 . txt ’
1757 W r i t e ( F i l e n a m e 5 , ’ (A, A, A, I 2 . 2 ,A) ’ ) ’D : / h i j n e k a m / D e s k t o p / Program / P r o g r a m O u t p u t / S c e n a r i o s /’,
t r i m ( ID ) , ’ PumpedVol S c e n a r i o 0 5 . txt ’
1758 W r i t e ( F i l e n a m e 6 , ’ (A, A, A, I 2 . 2 ,A) ’ ) ’D : / h i j n e k a m / D e s k t o p / Program / P r o g r a m O u t p u t / S c e n a r i o s /’,
t r i m ( ID ) , ’ PumpedVol S c e n a r i o 0 6 . txt ’
1759 W r i t e ( F i l e n a m e 7 , ’ (A, A, A, I 2 . 2 ,A) ’ ) ’D : / h i j n e k a m / D e s k t o p / Program / P r o g r a m O u t p u t / S c e n a r i o s /’,
t r i m ( ID ) , ’ PumpedVol S c e n a r i o 0 7 . txt ’
1760 W r i t e ( F i l e n a m e 8 , ’ (A, A, A, I 2 . 2 ,A) ’ ) ’D : / h i j n e k a m / D e s k t o p / Program / P r o g r a m O u t p u t / S c e n a r i o s /’,
t r i m ( ID ) , ’ PumpedVol S c e n a r i o 0 8 . txt ’
1761 W r i t e ( F i l e n a m e 9 , ’ (A, A, A, I 2 . 2 ,A) ’ ) ’D : / h i j n e k a m / D e s k t o p / Program / P r o g r a m O u t p u t / S c e n a r i o s /’,
t r i m ( ID ) , ’ PumpedVol S c e n a r i o 0 9 . txt ’
1762
1763 Open ( Temp , f i l e = F i l e n a m e 0 )
1764 n0 = l i n e c o u n t ( Temp )
1765
1766 A l l o c a t e ( Var ( n0 ) )
1767
1768 Do i =1 , n0
1769 Read ( Temp , ’ (A) ’ ) Var ( i )
1770 I f ( v a r ( i ) . eq . " " ) v a r ( i ) = " "
1771 End Do
1772
1773 D a t e T i m e S o u r c e = Var ( n0 )
1774
1775 D e a l l o c a t e ( Var )
1776 C l o s e ( Temp )
1777
1778 Y = 12 ! Amount o f h o u r s t h a t w i l l be s u b s t r a c t e d from t h e s o u r c e d a t e t i m e and a d d e d
t o i t , i n o r d e r t o r e s p e c t i v e l y form t h e mimimum and maximum o f t h e zoomed p l o t
1779 C a l l ZoomGPHours ( D a t e T i m e S o u r c e , DateTimeMin , DateTimeMax , Y)
1780
1781 g_title0 = ’Away ’
1782 g_title1 = ’ Scenario 01 ’
1783 g_title2 = ’ Scenario 02 ’
1784 g_title3 = ’ Scenario 03 ’
1785 g_title4 = ’ Scenario 04 ’
1786 g_title5 = ’ Scenario 05 ’
1787 g_title6 = ’ Scenario 06 ’
1788 g_title7 = ’ Scenario 07 ’
259
1789 g_title8 = ’ S c e n a r i o 08 ’
1790 g_title9 = ’ S c e n a r i o 09 ’
1791
1792 ! C r e a t e g n u p l o t command f i l e
1793 ! −−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−
1794 OPEN( 1 0 , ACCESS= ’SEQUENTIAL ’ , FILE= ’ gp . t x t ’ )
1795 W r i t e ( 1 0 , ’ (A) ’ ) ’ s e t t e r m i n a l p n g c a i r o s i z e 1 8 0 0 , 1 8 0 0 ’ ! Sets i t to
c r e a t e . png
1796 W r i t e ( 1 0 , ’ (A) ’ ) ’ s e t o u t p u t ’ / / ’ " ’ / / ’D : / h i j n e k a m / D e s k t o p / Program / G r a p h s / P l o t S c e n a r i o s /
P l o t _ S c e n a r i o s _ ’ / / t r i m ( ID ) / / ’ . png ’ / / ’ " ’ ! C r e a t e s . png f i l e and s t o r e s i t i n
a d i f f e r e n t f o l d e r . The " / " u s e d i s d i f f e r e n t from t h e d e f a u l t o r f o r t r a n ( " \ " ) ! ! !
1797
1798 W r i t e ( 1 0 , ’ (A) ’ ) ’ s e t t i t l e f o n t " , 2 8 " ’ / / ’ " { / : Bold ’ / / t r i m ( T i t l e ) / / ’ } " ’ ! Graph T i t l e ,
t i t l e in bold
1799 W r i t e ( 1 0 , ’ (A) ’ ) ’ s e t x d a t a t i m e ’
1800 W r i t e ( 1 0 , ’ (A) ’ ) ’ s e t t i m e f m t ’ ’%d−%m−%Y %H:%M:%S ’ ’ ’
1801 W r i t e ( 1 0 , ’ (A) ’ ) ’ s e t x l a b e l f o n t " , 2 4 " ’ / / ’ " ’ / / TRIM ( x l a b e l ) / / ’ " o f f s e t 0 , − 1 . 5 ’ !
O f f s e t c h a n g e s t h e p o s i t i o n o f t h e t i t l e , i n t h i s c a s e l o w e r s i t , w / o i t t h e t i t l e and
t i c l a b e l s o v e r l a p . F i r s t number o f f s e t s t h e h o r i z o n t a l p o s i t i o n .
1802 W r i t e ( 1 0 , ’ (A) ’ ) ’ s e t y l a b e l f o n t " , 2 4 " ’ / / ’ " ’ / / TRIM ( y l a b e l ) / / ’ " ’
1803
1804 W r i t e ( 1 0 , ’ (A) ’ ) ’ s e t key f o n t " , 2 0 " o p a q u e r i g h t t o p box ’
1805
1806 W r i t e ( 1 0 , ’ ( 5 (A) ) ’ ) ’ s e t x r a n g e [ " ’ , DateTimeMin , ’ " : " ’ , DateTimeMax , ’ " ] ’
1807 W r i t e ( 1 0 , ’ (A) ’ ) ’ s e t yrange [ 0 : * ] ’
1808
1809 W r i t e ( 1 0 , ’ (A) ’ ) ’ s e t g r i d ’
1810
1811 W r i t e ( 1 0 , ’ (A) ’ ) ’ set lmargin at screen 0.05 ’
1812 ! W r i t e ( 1 0 , ’ (A) ’ ) ’ s e t rmargin at screen 0.85 ’
1813 W r i t e ( 1 0 , ’ (A) ’ ) ’ s e t bmargin a t screen 0.06 ’
1814 W r i t e ( 1 0 , ’ (A) ’ ) ’ set tmargin at screen 0.95 ’
1815
1816 Call GraphStyle ( Style1 , Layout1 )
1817 Call GraphStyle ( Style2 , Layout2 )
1818 Call GraphStyle ( Style3 , Layout3 )
1819 Call GraphStyle ( Style4 , Layout4 )
1820 Call GraphStyle ( Style5 , Layout5 )
1821 Call GraphStyle ( Style6 , Layout6 )
1822 Call GraphStyle ( Style7 , Layout7 )
1823 Call GraphStyle ( Style8 , Layout8 )
1824 Call GraphStyle ( Style9 , Layout9 )
1825 Call GraphStyle ( Style0 , Layout0 )
1826
1827 W r i t e ( 1 0 , ’ (A) ’ ) ’ p l o t " ’ / / t r i m ( f i l e n a m e 0 ) / / ’ " u s i n g 1 : 3 w i t h ’ / / t r i m ( L a y o u t 0 ) / / ’ t i t l e " ’ / /
TRIM ( g _ t i t l e 0 ) / / ’ " , " ’ / / t r i m ( f i l e n a m e 1 ) / / ’ " u s i n g 1 : 3 w i t h ’ / / t r i m ( L a y o u t 1 ) / / ’ t i t l e " ’ / /
TRIM ( g _ t i t l e 1 ) / / ’ " , " ’ / / t r i m ( f i l e n a m e 2 ) / / ’ " u s i n g 1 : 3 w i t h ’ / / t r i m ( L a y o u t 2 ) / / ’ t i t l e " ’ / /
TRIM ( g _ t i t l e 2 ) / / ’ " , " ’ / / t r i m ( f i l e n a m e 3 ) / / ’ " u s i n g 1 : 3 w i t h ’ / / t r i m ( L a y o u t 3 ) / / ’ t i t l e " ’ / /
TRIM ( g _ t i t l e 3 ) / / ’ " , " ’ / / t r i m ( f i l e n a m e 4 ) / / ’ " u s i n g 1 : 3 w i t h ’ / / t r i m ( L a y o u t 4 ) / / ’ t i t l e " ’ / /
TRIM ( g _ t i t l e 4 ) / / ’ " , " ’ / / t r i m ( f i l e n a m e 5 ) / / ’ " u s i n g 1 : 3 w i t h ’ / / t r i m ( L a y o u t 5 ) / / ’ t i t l e " ’ / /
TRIM ( g _ t i t l e 5 ) / / ’ " , " ’ / / t r i m ( f i l e n a m e 6 ) / / ’ " u s i n g 1 : 3 w i t h ’ / / t r i m ( L a y o u t 6 ) / / ’ t i t l e " ’ / /
TRIM ( g _ t i t l e 6 ) / / ’ " , " ’ / / t r i m ( f i l e n a m e 7 ) / / ’ " u s i n g 1 : 3 w i t h ’ / / t r i m ( L a y o u t 7 ) / / ’ t i t l e " ’ / /
TRIM ( g _ t i t l e 7 ) / / ’ " , " ’ / / t r i m ( f i l e n a m e 8 ) / / ’ " u s i n g 1 : 3 w i t h ’ / / t r i m ( L a y o u t 8 ) / / ’ t i t l e " ’ / /
TRIM ( g _ t i t l e 8 ) / / ’ " , " ’ / / t r i m ( f i l e n a m e 9 ) / / ’ " u s i n g 1 : 3 w i t h ’ / / t r i m ( L a y o u t 9 ) / / ’ t i t l e " ’ / /
TRIM ( g _ t i t l e 9 ) / / ’ " ’ ! B e c a u s e G n u p l o t r e a d s t i m e and d a t a a s two s e p a r a t e c o l u m n s
t h e y − d a t a becomes column 3 .
1828
1829 CLOSE ( 1 0 , STATUS= ’KEEP ’ )
1830
1831 ! P l o t c u r v e w i t h g n u p l o t and c l e a n u p f i l e s
1832 ! −−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−
1833 C a l l SYSTEM( ’ g n u p l o t gp . t x t ’ )
1834
1835 ! Pause ! E n a b l e t o c h e c k t h e gnu f i l e b e f o r e d e l e t i o n i f t h e g r a p h i s n o t a s
expected .
1836
1837 C a l l SYSTEM( ’ d e l gp . t x t ’ )
1838
1839 ! Check m e s s a g e
1840 ! −−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−
1841 W r i t e ( * , ’ (A) ’ ) ’ F i l e " P l o t S c e n a r i o s ’ / / t r i m ( ID ) / / ’ . png " i s c r e a t e d . ’
260 F. Code of the MarsdiepVisual Program
1842
1843 End S u b r o u t i n e
1844
1845 ! −−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−
1846
1847 S u b r o u t i n e f2gpwBGFm ( S c e n a r i o N o , BackgroundName , t i t l e , x l a b e l , y l a b e l , F i l e 1 , g t i t l e 1 , S t y l e 1 , F i l e 2
, g t i t l e 2 , Style2 , File3 , g t i t l e 3 , Style3 , File4 , g t i t l e 4 , Style4 , File5 , g t i t l e 5 , Style5 , File6 ,
g t i t l e 6 , Style6 , File7 , g t i t l e 7 , Style7 , File8 , g t i t l e 8 , Style8 )
1848 ! I m p l e m e n t a p i c t u r e f o r t h e b a c k g r o u n d . Based on a m o n g s t o t h e r s ; h t t p : / / www. g n u p l o t t i n g .
o r g / t a g / image / .
1849 ! And p l o t s r e s u l t s o f t h e Sample S o u r c e p r o g r a m on t o p o f i t .
1850 I m p l i c i t None
1851
1852 Character (*) :: File1 , File2 , File3 , File4 , File5 , File6 , File7 , File8
1853 Character (*) :: gtitle1 , gtitle2 , gtitle3 , gtitle4 , gtitle5 , gtitle6 , gtitle7 , gtitle8
1854 Character (2) :: Style1 , Style2 , Style3 , Style4 , Style5 , Style6 , Style7 , Style8
1855 Character (25) :: Layout1 , Layout2 , Layout3 , Layout4 , Layout5 , Layout6 , Layout7 ,
Layout8
1856 Character (*) :: title
1857 C h a r a c t e r ( l e n =* ) :: xlabel , ylabel
1858 Integer :: ScenarioNo
1859 Character (50) :: F i l e n a m e , BackgroundName
1860 Character (50) :: Command
1861
1862 ! C r e a t e g n u p l o t command f i l e
1863 ! −−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−
1864 OPEN( 1 0 , ACCESS= ’SEQUENTIAL ’ , FILE= ’ gp . t x t ’ )
1865 W r i t e ( 1 0 , ’ (A) ’ ) ’ s e t t e r m i n a l p n g c a i r o s i z e 4 8 0 0 , 2 8 0 0 ’ ! linewidth 2.0 font " ,40"
s i z e 2000 ,1000 ’
1866 W r i t e ( F i l e n a m e , ’ (A, I 2 . 2 ,A) ’ ) t r i m ( BackgroundName ) / / " _ S c e n a r i o _ " , S c e n a r i o N o , " . png "
1867 W r i t e ( 1 0 , ’ (A) ’ ) ’ s e t o u t p u t ’ / / ’ " ’ / / ’D : / h i j n e k a m / D e s k t o p / Program / G r a p h s / C r o s s S e c t i o n s / ’ / / t r i m
( Filename ) / / ’ " ’
1868 W r i t e ( 1 0 , ’ (A) ’ ) ’ s e t t i t l e " ’ / / t r i m ( t i t l e ) / / ’ " f o n t " , 3 2 " ’
1869
1870 W r i t e ( 1 0 , ’ (A) ’ ) ’ s e t s i z e 0 . 9 ’
1871 W r i t e ( 1 0 , ’ (A) ’ ) ’ s e t o r i g i n 0 . 0 5 , 0 . 0 5 ’
1872
1873 W r i t e ( 1 0 , ’ (A) ’ ) ’ s e t x r a n g e [ − 650 : 6110 ] ’ ! Found m a n u a l l y b a s e d on
the picture used , s i n c e i t a l r e a d y c o n t a i n s a s c a l e . . .
1874 W r i t e ( 1 0 , ’ (A) ’ ) ’ s e t x t i c s o u t n o m i r r o r r o t a t e by −90 ’
1875 W r i t e ( 1 0 , ’ (A) ’ ) ’ s e t x l a b e l ’ / / ’ " ’ / / Trim ( x l a b e l ) / / ’ " f o n t " , 2 8 " o f f s e t − 4 ,4 ’
1876 W r i t e ( 1 0 , ’ (A) ’ ) ’ s e t x2range [ 0 : * ] ’ ! noreverse nowriteback ’
1877 W r i t e ( 1 0 , ’ (A) ’ ) ’ unset x2tics ’
1878
1879 Write (10 , ’ (A) ’) ’ s e t y r a n g e [ − 153.5 : 32 ] ’ ! Idem d i t o . . .
1880 Write (10 , ’ (A) ’) ’ unset ytics ’
1881 Write (10 , ’ (A) ’) ’ s e t y l a b e l ’ / / ’ " ’ / / Trim ( y l a b e l ) / / ’ " f o n t " , 2 8 " o f f s e t − 4 ,0 ’
1882 Write (10 , ’ (A) ’) ’ s e t y2range [ 0 : * ] ’ ! noreverse nowriteback ’
1883 Write (10 , ’ (A) ’) ’ unset y2tics ’
1884
1885 W r i t e ( 1 0 , ’ (A) ’ ) ’ s e t g r i d f r o n t lw 3 ’
1886
1887 Write (10 , ’ (A) ’) ’ set lmargin at screen 0.03 ’
1888 Write (10 , ’ (A) ’) ’ set rmargin at screen 0.99 ’
1889 Write (10 , ’ (A) ’) ’ set bmargin at screen 0.06 ’
1890 Write (10 , ’ (A) ’) ’ set tmargin at screen 0.95 ’
1891
1892 W r i t e ( 1 0 , ’ (A) ’ ) ’ s e t key a t 2825 , − 100 L e f t r e v e r s e box l t −1 o p a q u e f o n t " , 2 4 " ’
1893
1894 Call GraphStyle ( Style1 , Layout1 )
1895 Call GraphStyle ( Style2 , Layout2 )
1896 Call GraphStyle ( Style3 , Layout3 )
1897 Call GraphStyle ( Style4 , Layout4 )
1898 Call GraphStyle ( Style5 , Layout5 )
1899 Call GraphStyle ( Style6 , Layout6 )
1900 Call GraphStyle ( Style7 , Layout7 )
1901 Call GraphStyle ( Style8 , Layout8 )
1902
1903 W r i t e ( 1 0 , ’ (A) ’ ) ’ s e t s t y l e c i r c l e r a d i u s g r a p h 0 . 0 0 3 ’
1904
1905 W r i t e ( 1 0 , ’ (A) ’ ) ’ p l o t " ’ / / t r i m ( BackgroundName ) / / ’ . png " b i n a r y f i l e t y p e =png u s i n g 1 : 2 : 3 : ( 2 2 5 )
261
2034 E l s e I f ( P r e s e n t ( y d a t a 3 ) ) Then
2035 W r i t e ( 1 0 , ’ (A) ’ ) ’ p l o t " x y d a t a 1 . d a t " u s i n g 2 : 3 : x t i c l a b e l s ( 1 ) w i t h ’ / / t r i m ( L a y o u t 1 ) / / ’
t i t l e " ’ / / TRIM ( g r a p h _ t i t l e 1 ) / / ’ " , " x y d a t a 1 . d a t " u s i n g 2 : 4 : x t i c l a b e l s ( 1 ) w i t h ’ / / t r i m (
L a y o u t 2 ) / / ’ t i t l e " ’ / / TRIM ( g r a p h _ t i t l e 2 ) / / ’ " , " x y d a t a 1 . d a t " u s i n g 2 : 5 : x t i c l a b e l s ( 1 ) w i t h
’ / / t r i m ( L a y o u t 3 ) / / ’ t i t l e " ’ / / TRIM ( g r a p h _ t i t l e 3 ) / / ’ " ’
2036 E l s e I f ( P r e s e n t ( y d a t a 2 ) ) Then
2037 W r i t e ( 1 0 , ’ (A) ’ ) ’ p l o t " x y d a t a 1 . d a t " u s i n g 2 : 3 : x t i c l a b e l s ( 1 ) w i t h ’ / / t r i m ( L a y o u t 1 ) / / ’
t i t l e " ’ / / TRIM ( g r a p h _ t i t l e 1 ) / / ’ " , " x y d a t a 1 . d a t " u s i n g 2 : 4 : x t i c l a b e l s ( 1 ) w i t h ’ / / t r i m (
L a y o u t 2 ) / / ’ t i t l e " ’ / / TRIM ( g r a p h _ t i t l e 2 ) / / ’ " ’
2038 Else
2039 W r i t e ( 1 0 , ’ (A) ’ ) ’ p l o t " x y d a t a 1 . d a t " u s i n g 2 : 3 : x t i c l a b e l s ( 1 ) w i t h ’ / / t r i m ( L a y o u t 1 ) / / ’
t i t l e " ’ / / TRIM ( g r a p h _ t i t l e 1 ) / / ’ " ’
2040 End I f
2041
2042 CLOSE ( 1 0 , STATUS= ’KEEP ’ )
2043
2044 ! P l o t c u r v e w i t h g n u p l o t and c l e a n u p f i l e s
2045 ! −−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−
2046 C a l l SYSTEM( ’ g n u p l o t gp . t x t ’ )
2047
2048 ! Pause ! To c h e c k t h e gnu f i l e b e f o r e d e l e t i o n i f t h e g r a p h i s n o t a s e x p e c t e d
.
2049
2050 C a l l SYSTEM( ’ d e l gp . t x t ’ )
2051 C a l l SYSTEM( ’ d e l x y d a t a 1 . d a t ’ )
2052
2053 ! Check m e s s a g e
2054 ! −−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−
2055 W r i t e ( * , ’ (A) ’ ) ’ F i l e " P l o t ’ / / t r i m ( T i t l e ) / / ’ . png " i s c r e a t e d . ’
2056
2057 End S u b r o u t i n e
2058
2059 ! −−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−
2060
2061 S u b r o u t i n e f2gpYPData ( L o c a t i o n , name , t i t l e , x l a b e l , y l a b e l , x d a t a , y d a t a 1 , g r a p h _ t i t l e 1 , s t y l e 1 ,
ydata2 , g r a p h _ t i t l e 2 , s t y l e 2 , ydata3 , g r a p h _ t i t l e 3 , s t y l e 3 , ydata4 , g r a p h _ t i t l e 4 , s t y l e 4 ,
ydata5 , g r a p h _ t i t l e 5 , s t y l e 5 , ydata6 , g r a p h _ t i t l e 6 , s t y l e 6 , ydata7 , g r a p h _ t i t l e 7 , s t y l e 7
, ydata8 , g r a p h _ t i t l e 8 , s t y l e 8 , ydata9 , g r a p h _ t i t l e 9 , s t y l e 9 , ydata10 , g r a p h _ t i t l e 1 0 ,
style10 )
2062 ! S u b r o u t i n e f2gpRHData p l o t s t h e r e s u l t s o f t h e v i s c o m e t e r
2063 I m p l i c i t None
2064
2065 Integer : : n1 ! number o f d a t a p o i n t s
2066 Character (*) :: xdata ( : ) ! f i r s t x data array
2067 Real :: ydata1 ( : )
2068 Real , Optional :: ydata2 ( : ) , ydata3 ( : ) , ydata4 ( : ) , ydata5 ( : ) , ydata6 ( : ) , ydata7 ( : ) , ydata8
( : ) , ydata9 ( : ) , ydata10 ( : )
2069 C h a r a c t e r ( l e n =* ) :: x l a b e l , y l a b e l , t i t l e , name ! p l o t a x i s l a b e l s and
title (s)
2070 Character (10) :: Location
2071 Integer :: i
2072 Character (*) :: graph_title1
2073 Character (*) , Optional :: graph_title2 , graph_title3 , graph_title4 , graph_title5 ,
graph_title6 , graph_title7 , graph_title8 , graph_title9 , graph_title10
2074 Character (2) :: style1
2075 Character (2) , Optional :: style2 , style3 , style4 , style5 , style6 , style7 , style8 , style9 ,
style10
2076 Character (25) :: Layout1 , Layout2 , Layout3 , Layout4 , Layout5 , Layout6 , Layout7 ,
Layout8 , Layout9 , L a y o u t 1 0
2077 Character (25) :: Layout99
2078
2079 n1 = s i z e ( x d a t a )
2080
2081 ! −−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−
2082 ! Write data in f i l e s
2083 ! −−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−
2084 OPEN( 1 0 , A c c e s s = ’SEQUENTIAL ’ , F i l e = ’ x y d a t a 1 . d a t ’ )
2085
2086 I f ( P r e s e n t ( y d a t a 1 0 ) ) Then
2087 Do i =1 , n1
2088 W r i t e ( 1 0 , ’ (A, I , 1 0 ( F ) ) ’ ) x d a t a ( i ) , i , y d a t a 1 ( i ) , y d a t a 2 ( i ) , y d a t a 3 ( i ) , y d a t a 4 ( i ) , y d a t a 5 ( i ) ,
265
2149
2150 W r i t e ( 1 0 , * ) ’ s e t x t i c s r o t a t e by −90 ’ ! s a m p l e c o d e on t h e r i g h t m i s s e s a p a r t i f −45
2151 Write (10 , * ) ’ s e t g r i d ’ ! show g r i d l i n e s i n t h e xy p l a n e
2152
2153 C a l l GraphStyle ( Style1 , Layout1 )
2154 I f ( P r e s e n t ( S t y l e 2 ) ) C a l l GraphStyle ( Style2 , Layout2 )
2155 I f ( P r e s e n t ( S t y l e 3 ) ) C a l l GraphStyle ( Style3 , Layout3 )
2156 I f ( P r e s e n t ( S t y l e 4 ) ) C a l l GraphStyle ( Style4 , Layout4 )
2157 I f ( P r e s e n t ( S t y l e 5 ) ) C a l l GraphStyle ( Style5 , Layout5 )
2158 I f ( P r e s e n t ( S t y l e 6 ) ) C a l l GraphStyle ( Style6 , Layout6 )
2159 I f ( P r e s e n t ( S t y l e 7 ) ) C a l l GraphStyle ( Style7 , Layout7 )
2160 I f ( P r e s e n t ( S t y l e 8 ) ) C a l l GraphStyle ( Style8 , Layout8 )
2161 I f ( P r e s e n t ( S t y l e 9 ) ) C a l l GraphStyle ( Style9 , Layout9 )
2162 I f ( P r e s e n t ( S t y l e 1 0 ) ) C a l l GraphStyle ( Style10 , Layout10 )
2163
2164 C a l l G r a p h S t y l e ( ’ 1m’ , L a y o u t 9 9 )
2165
2166 I f ( P r e s e n t ( y d a t a 1 0 ) ) Then
2167 W r i t e ( 1 0 , ’ (A) ’ ) ’ p l o t " x y d a t a 1 . d a t " u s i n g 2 : 3 : x t i c l a b e l s ( 1 ) w i t h ’ / / t r i m ( L a y o u t 1 ) / / ’
t i t l e " ’ / / TRIM ( g r a p h _ t i t l e 1 ) / / ’ " , " x y d a t a 1 . d a t " u s i n g 2 : 4 : x t i c l a b e l s ( 1 ) w i t h ’ / / t r i m (
L a y o u t 2 ) / / ’ t i t l e " ’ / / TRIM ( g r a p h _ t i t l e 2 ) / / ’ " , " x y d a t a 1 . d a t " u s i n g 2 : 5 : x t i c l a b e l s ( 1 ) w i t h
’ / / t r i m ( L a y o u t 3 ) / / ’ t i t l e " ’ / / TRIM ( g r a p h _ t i t l e 3 ) / / ’ " , " x y d a t a 1 . d a t " u s i n g 2 : 6 : x t i c l a b e l s
( 1 ) w i t h ’ / / t r i m ( L a y o u t 4 ) / / ’ t i t l e " ’ / / TRIM ( g r a p h _ t i t l e 4 ) / / ’ " , " x y d a t a 1 . d a t " u s i n g 2 : 7 :
x t i c l a b e l s ( 1 ) w i t h ’ / / t r i m ( L a y o u t 5 ) / / ’ t i t l e " ’ / / TRIM ( g r a p h _ t i t l e 5 ) / / ’ " , " x y d a t a 1 . d a t "
u s i n g 2 : 8 : x t i c l a b e l s ( 1 ) w i t h ’ / / t r i m ( L a y o u t 6 ) / / ’ t i t l e " ’ / / TRIM ( g r a p h _ t i t l e 6 ) / / ’ " , "
x y d a t a 1 . d a t " u s i n g 2 : 9 : x t i c l a b e l s ( 1 ) w i t h ’ / / t r i m ( L a y o u t 7 ) / / ’ t i t l e " ’ / / TRIM ( g r a p h _ t i t l e 7
) / / ’ " , " x y d a t a 1 . d a t " u s i n g 2 : 1 0 : x t i c l a b e l s ( 1 ) w i t h ’ / / t r i m ( L a y o u t 8 ) / / ’ t i t l e " ’ / / TRIM (
g r a p h _ t i t l e 8 ) / / ’ " , " xydata1 . d a t " using 2 : 1 1 : x t i c l a b e l s ( 1 ) with ’ / / t r i m ( Layout9 ) / / ’ t i t l e "
’ / / TRIM ( g r a p h _ t i t l e 9 ) / / ’ " , " x y d a t a 1 . d a t " u s i n g 2 : 1 2 : x t i c l a b e l s ( 1 ) w i t h ’ / / t r i m ( L a y o u t 1 0 ) / /
’ t i t l e " ’ / / TRIM ( g r a p h _ t i t l e 1 0 ) / / ’ " ’
2168 E l s e I f ( P r e s e n t ( y d a t a 9 ) ) Then
2169 W r i t e ( 1 0 , ’ (A) ’ ) ’ p l o t " x y d a t a 1 . d a t " u s i n g 2 : 3 : x t i c l a b e l s ( 1 ) w i t h ’ / / t r i m ( L a y o u t 1 ) / / ’
t i t l e " ’ / / TRIM ( g r a p h _ t i t l e 1 ) / / ’ " , " x y d a t a 1 . d a t " u s i n g 2 : 4 : x t i c l a b e l s ( 1 ) w i t h ’ / / t r i m (
L a y o u t 2 ) / / ’ t i t l e " ’ / / TRIM ( g r a p h _ t i t l e 2 ) / / ’ " , " x y d a t a 1 . d a t " u s i n g 2 : 5 : x t i c l a b e l s ( 1 ) w i t h
’ / / t r i m ( L a y o u t 3 ) / / ’ t i t l e " ’ / / TRIM ( g r a p h _ t i t l e 3 ) / / ’ " , " x y d a t a 1 . d a t " u s i n g 2 : 6 : x t i c l a b e l s
( 1 ) w i t h ’ / / t r i m ( L a y o u t 4 ) / / ’ t i t l e " ’ / / TRIM ( g r a p h _ t i t l e 4 ) / / ’ " , " x y d a t a 1 . d a t " u s i n g 2 : 7 :
x t i c l a b e l s ( 1 ) w i t h ’ / / t r i m ( L a y o u t 5 ) / / ’ t i t l e " ’ / / TRIM ( g r a p h _ t i t l e 5 ) / / ’ " , " x y d a t a 1 . d a t "
u s i n g 2 : 8 : x t i c l a b e l s ( 1 ) w i t h ’ / / t r i m ( L a y o u t 6 ) / / ’ t i t l e " ’ / / TRIM ( g r a p h _ t i t l e 6 ) / / ’ " , "
x y d a t a 1 . d a t " u s i n g 2 : 9 : x t i c l a b e l s ( 1 ) w i t h ’ / / t r i m ( L a y o u t 7 ) / / ’ t i t l e " ’ / / TRIM ( g r a p h _ t i t l e 7
) / / ’ " , " x y d a t a 1 . d a t " u s i n g 2 : 1 0 : x t i c l a b e l s ( 1 ) w i t h ’ / / t r i m ( L a y o u t 8 ) / / ’ t i t l e " ’ / / TRIM (
g r a p h _ t i t l e 8 ) / / ’ " , " xydata1 . d a t " using 2 : 1 1 : x t i c l a b e l s ( 1 ) with ’ / / t r i m ( Layout9 ) / / ’ t i t l e "
’ / / TRIM ( g r a p h _ t i t l e 9 ) / / ’ " ’
2170 E l s e I f ( P r e s e n t ( y d a t a 8 ) ) Then
2171 W r i t e ( 1 0 , ’ (A) ’ ) ’ p l o t " x y d a t a 1 . d a t " u s i n g 2 : 3 : x t i c l a b e l s ( 1 ) w i t h ’ / / t r i m ( L a y o u t 1 ) / / ’
t i t l e " ’ / / TRIM ( g r a p h _ t i t l e 1 ) / / ’ " , " x y d a t a 1 . d a t " u s i n g 2 : 4 : x t i c l a b e l s ( 1 ) w i t h ’ / / t r i m (
L a y o u t 2 ) / / ’ t i t l e " ’ / / TRIM ( g r a p h _ t i t l e 2 ) / / ’ " , " x y d a t a 1 . d a t " u s i n g 2 : 5 : x t i c l a b e l s ( 1 ) w i t h
’ / / t r i m ( L a y o u t 3 ) / / ’ t i t l e " ’ / / TRIM ( g r a p h _ t i t l e 3 ) / / ’ " , " x y d a t a 1 . d a t " u s i n g 2 : 6 : x t i c l a b e l s
( 1 ) w i t h ’ / / t r i m ( L a y o u t 4 ) / / ’ t i t l e " ’ / / TRIM ( g r a p h _ t i t l e 4 ) / / ’ " , " x y d a t a 1 . d a t " u s i n g 2 : 7 :
x t i c l a b e l s ( 1 ) w i t h ’ / / t r i m ( L a y o u t 5 ) / / ’ t i t l e " ’ / / TRIM ( g r a p h _ t i t l e 5 ) / / ’ " , " x y d a t a 1 . d a t "
u s i n g 2 : 8 : x t i c l a b e l s ( 1 ) w i t h ’ / / t r i m ( L a y o u t 6 ) / / ’ t i t l e " ’ / / TRIM ( g r a p h _ t i t l e 6 ) / / ’ " , "
x y d a t a 1 . d a t " u s i n g 2 : 9 : x t i c l a b e l s ( 1 ) w i t h ’ / / t r i m ( L a y o u t 7 ) / / ’ t i t l e " ’ / / TRIM ( g r a p h _ t i t l e 7
) / / ’ " , " x y d a t a 1 . d a t " u s i n g 2 : 1 0 : x t i c l a b e l s ( 1 ) w i t h ’ / / t r i m ( L a y o u t 8 ) / / ’ t i t l e " ’ / / TRIM (
graph_title8 ) // ’" ’
2172 E l s e I f ( P r e s e n t ( y d a t a 7 ) ) Then
2173 W r i t e ( 1 0 , ’ (A) ’ ) ’ p l o t " x y d a t a 1 . d a t " u s i n g 2 : 3 : x t i c l a b e l s ( 1 ) w i t h ’ / / t r i m ( L a y o u t 1 ) / / ’
t i t l e " ’ / / TRIM ( g r a p h _ t i t l e 1 ) / / ’ " , " x y d a t a 1 . d a t " u s i n g 2 : 4 : x t i c l a b e l s ( 1 ) w i t h ’ / / t r i m (
L a y o u t 2 ) / / ’ t i t l e " ’ / / TRIM ( g r a p h _ t i t l e 2 ) / / ’ " , " x y d a t a 1 . d a t " u s i n g 2 : 5 : x t i c l a b e l s ( 1 ) w i t h
’ / / t r i m ( L a y o u t 3 ) / / ’ t i t l e " ’ / / TRIM ( g r a p h _ t i t l e 3 ) / / ’ " , " x y d a t a 1 . d a t " u s i n g 2 : 6 : x t i c l a b e l s
( 1 ) w i t h ’ / / t r i m ( L a y o u t 4 ) / / ’ t i t l e " ’ / / TRIM ( g r a p h _ t i t l e 4 ) / / ’ " , " x y d a t a 1 . d a t " u s i n g 2 : 7 :
x t i c l a b e l s ( 1 ) w i t h ’ / / t r i m ( L a y o u t 5 ) / / ’ t i t l e " ’ / / TRIM ( g r a p h _ t i t l e 5 ) / / ’ " , " x y d a t a 1 . d a t "
u s i n g 2 : 8 : x t i c l a b e l s ( 1 ) w i t h ’ / / t r i m ( L a y o u t 6 ) / / ’ t i t l e " ’ / / TRIM ( g r a p h _ t i t l e 6 ) / / ’ " , "
x y d a t a 1 . d a t " u s i n g 2 : 9 : x t i c l a b e l s ( 1 ) w i t h ’ / / t r i m ( L a y o u t 7 ) / / ’ t i t l e " ’ / / TRIM ( g r a p h _ t i t l e 7
) // ’" ’
2174 E l s e I f ( P r e s e n t ( y d a t a 6 ) ) Then
2175 W r i t e ( 1 0 , ’ (A) ’ ) ’ p l o t " x y d a t a 1 . d a t " u s i n g 2 : 3 : x t i c l a b e l s ( 1 ) w i t h ’ / / t r i m ( L a y o u t 1 ) / / ’
t i t l e " ’ / / TRIM ( g r a p h _ t i t l e 1 ) / / ’ " , " x y d a t a 1 . d a t " u s i n g 2 : 4 : x t i c l a b e l s ( 1 ) w i t h ’ / / t r i m (
L a y o u t 2 ) / / ’ t i t l e " ’ / / TRIM ( g r a p h _ t i t l e 2 ) / / ’ " , " x y d a t a 1 . d a t " u s i n g 2 : 5 : x t i c l a b e l s ( 1 ) w i t h
’ / / t r i m ( L a y o u t 3 ) / / ’ t i t l e " ’ / / TRIM ( g r a p h _ t i t l e 3 ) / / ’ " , " x y d a t a 1 . d a t " u s i n g 2 : 6 : x t i c l a b e l s
( 1 ) w i t h ’ / / t r i m ( L a y o u t 4 ) / / ’ t i t l e " ’ / / TRIM ( g r a p h _ t i t l e 4 ) / / ’ " , " x y d a t a 1 . d a t " u s i n g 2 : 7 :
x t i c l a b e l s ( 1 ) w i t h ’ / / t r i m ( L a y o u t 5 ) / / ’ t i t l e " ’ / / TRIM ( g r a p h _ t i t l e 5 ) / / ’ " , " x y d a t a 1 . d a t "
u s i n g 2 : 8 : x t i c l a b e l s ( 1 ) w i t h ’ / / t r i m ( L a y o u t 6 ) / / ’ t i t l e " ’ / / TRIM ( g r a p h _ t i t l e 6 ) / / ’ " ’
267
2176 E l s e I f ( P r e s e n t ( y d a t a 5 ) ) Then
2177 W r i t e ( 1 0 , ’ (A) ’ ) ’ p l o t " x y d a t a 1 . d a t " u s i n g 2 : 3 : x t i c l a b e l s ( 1 ) w i t h ’ / / t r i m ( L a y o u t 1 ) / / ’
t i t l e " ’ / / TRIM ( g r a p h _ t i t l e 1 ) / / ’ " , " x y d a t a 1 . d a t " u s i n g 2 : 4 : x t i c l a b e l s ( 1 ) w i t h ’ / / t r i m (
L a y o u t 2 ) / / ’ t i t l e " ’ / / TRIM ( g r a p h _ t i t l e 2 ) / / ’ " , " x y d a t a 1 . d a t " u s i n g 2 : 5 : x t i c l a b e l s ( 1 ) w i t h
’ / / t r i m ( L a y o u t 3 ) / / ’ t i t l e " ’ / / TRIM ( g r a p h _ t i t l e 3 ) / / ’ " , " x y d a t a 1 . d a t " u s i n g 2 : 6 : x t i c l a b e l s
( 1 ) w i t h ’ / / t r i m ( L a y o u t 4 ) / / ’ t i t l e " ’ / / TRIM ( g r a p h _ t i t l e 4 ) / / ’ " , " x y d a t a 1 . d a t " u s i n g 2 : 7 :
x t i c l a b e l s ( 1 ) w i t h ’ / / t r i m ( L a y o u t 5 ) / / ’ t i t l e " ’ / / TRIM ( g r a p h _ t i t l e 5 ) / / ’ " ’
2178 E l s e I f ( P r e s e n t ( y d a t a 4 ) ) Then
2179 W r i t e ( 1 0 , ’ (A) ’ ) ’ p l o t " x y d a t a 1 . d a t " u s i n g 2 : 3 : x t i c l a b e l s ( 1 ) w i t h ’ / / t r i m ( L a y o u t 1 ) / / ’
t i t l e " ’ / / TRIM ( g r a p h _ t i t l e 1 ) / / ’ " a x e s x1y1 , " x y d a t a 1 . d a t " u s i n g 2 : 4 : x t i c l a b e l s ( 1 ) w i t h ’
/ / t r i m ( L a y o u t 2 ) / / ’ t i t l e " ’ / / TRIM ( g r a p h _ t i t l e 2 ) / / ’ " a x e s x1y1 , " x y d a t a 1 . d a t " u s i n g 2 : 5 :
x t i c l a b e l s ( 1 ) w i t h ’ / / t r i m ( L a y o u t 3 ) / / ’ t i t l e " ’ / / TRIM ( g r a p h _ t i t l e 3 ) / / ’ " a x e s x1y2 , "
x y d a t a 1 . d a t " u s i n g 2 : 6 : x t i c l a b e l s ( 1 ) w i t h ’ / / t r i m ( L a y o u t 4 ) / / ’ t i t l e " ’ / / TRIM ( g r a p h _ t i t l e 4
) / / ’ " a x e s x1y2 , " x y d a t a 1 . d a t " u s i n g 2 : 7 : x t i c l a b e l s ( 1 ) w i t h ’ / / t r i m ( L a y o u t 9 9 ) / / ’ t i t l e " ’
/ / TRIM ( t i t l e ) / / ’ " a x e s x1y2 ’
2180 E l s e I f ( P r e s e n t ( y d a t a 3 ) ) Then
2181 W r i t e ( 1 0 , ’ (A) ’ ) ’ p l o t " x y d a t a 1 . d a t " u s i n g 2 : 3 : x t i c l a b e l s ( 1 ) w i t h ’ / / t r i m ( L a y o u t 1 ) / / ’
t i t l e " ’ / / TRIM ( g r a p h _ t i t l e 1 ) / / ’ " , " x y d a t a 1 . d a t " u s i n g 2 : 4 : x t i c l a b e l s ( 1 ) w i t h ’ / / t r i m (
L a y o u t 2 ) / / ’ t i t l e " ’ / / TRIM ( g r a p h _ t i t l e 2 ) / / ’ " , " x y d a t a 1 . d a t " u s i n g 2 : 5 : x t i c l a b e l s ( 1 ) w i t h
’ / / t r i m ( L a y o u t 3 ) / / ’ t i t l e " ’ / / TRIM ( g r a p h _ t i t l e 3 ) / / ’ " ’
2182 E l s e I f ( P r e s e n t ( y d a t a 2 ) ) Then
2183 W r i t e ( 1 0 , ’ (A) ’ ) ’ p l o t " x y d a t a 1 . d a t " u s i n g 2 : 3 : x t i c l a b e l s ( 1 ) w i t h ’ / / t r i m ( L a y o u t 1 ) / / ’
t i t l e " ’ / / TRIM ( g r a p h _ t i t l e 1 ) / / ’ " , " x y d a t a 1 . d a t " u s i n g 2 : 4 : x t i c l a b e l s ( 1 ) w i t h ’ / / t r i m (
L a y o u t 2 ) / / ’ t i t l e " ’ / / TRIM ( g r a p h _ t i t l e 2 ) / / ’ " ’
2184 Else
2185 W r i t e ( 1 0 , ’ (A) ’ ) ’ p l o t " x y d a t a 1 . d a t " u s i n g 2 : 3 : x t i c l a b e l s ( 1 ) w i t h ’ / / t r i m ( L a y o u t 1 ) / / ’
t i t l e " ’ / / TRIM ( g r a p h _ t i t l e 1 ) / / ’ " ’
2186 End I f
2187
2188 CLOSE ( 1 0 , STATUS= ’KEEP ’ )
2189
2190 OPEN( 1 0 , ACCESS= ’SEQUENTIAL ’ , FILE= ’ gp2 . t x t ’ )
2191 W r i t e ( 1 0 , * ) ’ s e t t e r m i n a l png s i z e 2 2 0 0 , 9 0 0 ’ ! Sets i t to create .
png
2192 W r i t e ( 1 0 , ’ (A) ’ ) ’ s e t o u t p u t ’ / / ’ " ’ / / ’D : / h i j n e k a m / D e s k t o p / Program / G r a p h s / P l o t _ ’ / / t r i m ( S h o r t (
L o c a t i o n ) ) / / ’ _ ’ / / t r i m ( Name ) / / ’ . png ’ / / ’ " ’ ! C r e a t e s . png f i l e and s t o r e s i t
i n a d i f f e r e n t f o l d e r . The " / " u s e d i s d i f f e r e n t from t h e d e f a u l t o r f o r t r a n ( " \ " ) ! ! !
2193 W r i t e ( 1 0 , * ) ’ s e t t i t l e ’ / / ’ " { / : Bold ’ / / t r i m ( L o c a t i o n ) / / ’ ’ / / T i t l e / / ’ } " f o n t " , 2 0 " ’
! Graph T i t l e , t i t l e i n b o l d , works
2194 W r i t e ( 1 0 , * ) ’ s e t x l a b e l ’ / / ’ " ’ / / Trim ( x l a b e l ) / / ’ " f o n t " , 1 8 " ’
2195 Write (10 , * ) ’ s e t yrange [ 0 : 3 0 ] ’
2196 ! Write (10 , * ) ’ s e t y t i c s 0 ,25 ,150 ’
2197 W r i t e ( 1 0 , * ) ’ s e t y l a b e l " Y i e l d S t r e s s [ Pa ] " f o n t " , 1 8 " ’
2198 ! Write (10 , * ) ’ s e t y2range [ 0 : 3 0 ] ’
2199 ! Write (10 , * ) ’ s e t y 2 t i c s 0 ,5 ,30 ’
2200
2201 W r i t e ( 1 0 , * ) ’ s e t key l e f t i n s i d e box f o n t " , 1 6 " ’
2202
2203 W r i t e ( 1 0 , * ) ’ s e t x t i c s r o t a t e by −90 ’
2204 Write (10 , * ) ’ s e t g r i d ’ ! show g r i d l i n e s i n t h e xy p l a n e
2205
2206 C a l l GraphStyle ( Style1 , Layout1 )
2207 I f ( P r e s e n t ( S t y l e 2 ) ) C a l l GraphStyle ( Style2 , Layout2 )
2208 I f ( P r e s e n t ( S t y l e 3 ) ) C a l l GraphStyle ( Style3 , Layout3 )
2209 I f ( P r e s e n t ( S t y l e 4 ) ) C a l l GraphStyle ( Style4 , Layout4 )
2210 I f ( P r e s e n t ( S t y l e 5 ) ) C a l l GraphStyle ( Style5 , Layout5 )
2211 I f ( P r e s e n t ( S t y l e 6 ) ) C a l l GraphStyle ( Style6 , Layout6 )
2212 I f ( P r e s e n t ( S t y l e 7 ) ) C a l l GraphStyle ( Style7 , Layout7 )
2213 I f ( P r e s e n t ( S t y l e 8 ) ) C a l l GraphStyle ( Style8 , Layout8 )
2214 I f ( P r e s e n t ( S t y l e 9 ) ) C a l l GraphStyle ( Style9 , Layout9 )
2215 I f ( P r e s e n t ( S t y l e 1 0 ) ) C a l l GraphStyle ( Style10 , Layout10 )
2216
2217 C a l l G r a p h S t y l e ( ’ 1m’ , L a y o u t 9 9 )
2218 C a l l G r a p h S t y l e ( ’ 3k ’ , Layout3 )
2219 C a l l GraphStyle ( ’3 l ’ , Layout4 )
2220
2221 I f ( P r e s e n t ( y d a t a 1 0 ) ) Then
2222 W r i t e ( 1 0 , ’ (A) ’ ) ’ p l o t " x y d a t a 1 . d a t " u s i n g 2 : 3 : x t i c l a b e l s ( 1 ) w i t h ’ / / t r i m ( L a y o u t 1 ) / / ’
t i t l e " ’ / / TRIM ( g r a p h _ t i t l e 1 ) / / ’ " , " x y d a t a 1 . d a t " u s i n g 2 : 4 : x t i c l a b e l s ( 1 ) w i t h ’ / / t r i m (
L a y o u t 2 ) / / ’ t i t l e " ’ / / TRIM ( g r a p h _ t i t l e 2 ) / / ’ " , " x y d a t a 1 . d a t " u s i n g 2 : 5 : x t i c l a b e l s ( 1 ) w i t h
’ / / t r i m ( L a y o u t 3 ) / / ’ t i t l e " ’ / / TRIM ( g r a p h _ t i t l e 3 ) / / ’ " , " x y d a t a 1 . d a t " u s i n g 2 : 6 : x t i c l a b e l s
268 F. Code of the MarsdiepVisual Program
2428
2429 W r i t e ( 1 0 , * ) ’ s e t g r i d n o x t i c s y t i c s lw 2 ’ ! show g r i d l i n e s i n t h e xy p l a n e
2430
2431 W r i t e ( 1 0 , ’ (A) ’ ) ’ s e t x r a n g e [ 0 : 70 ] ’
2432 W r i t e ( 1 0 , ’ (A) ’ ) ’ s e t x 2 r a n g e [ 0 : * ] ’ ! noreverse nowriteback ’
2433 W r i t e ( 1 0 , ’ (A) ’ ) ’ u n s e t x 2 t i c s ’
2434
2435 Write (10 , ’ (A) ’) ’ set yrange [ 1 : 1 . 4 ] ’
2436 Write (10 , ’ (A) ’) ’ set y t i c s 1 ,0.1 ,1.4 nomirror ’
2437 Write (10 , ’ (A) ’) ’ set y2range [ 0 : 0.2 ] ’
2438 Write (10 , ’ (A) ’) ’ set y2tics 0 ,0.05 ,0.2 nomirror ’
2439
2440 W r i t e ( 1 0 , ’ (A) ’ ) ’ s e t l m a r g i n 15 ’
2441 W r i t e ( 1 0 , ’ (A) ’ ) ’ s e t r m a r g i n 15 ’
2442
2443 C a l l GraphStyle ( Style01 , Layout1 )
2444 C a l l GraphStyle ( Style02 , Layout2 )
2445
2446 W r i t e ( 1 0 , ’ (A) ’ ) ’ s e t a r r o w from 3 8 . 5 , 1 . 0 5 t o 3 8 . 5 , 1 . 4 f i l l e d n o h e a d l s 0 lw 3 ’
2447
2448 W r i t e ( 1 0 , ’ (A) ’ ) ’ p l o t " x y d a t a 1 . d a t " u s i n g 2 : 3 : x t i c l a b e l s ( 1 ) w i t h ’ / / t r i m ( L a y o u t 1 ) / / ’ t i t l e " ’
/ / TRIM ( g r a p h _ t i t l e 0 1 ) / / ’ " a x e s x1y1 , " x y d a t a 1 . d a t " u s i n g 2 : 4 : x t i c l a b e l s ( 1 ) w i t h ’ / / t r i m (
L a y o u t 2 ) / / ’ t i t l e " ’ / / TRIM ( g r a p h _ t i t l e 0 2 ) / / ’ " a x e s x1y2 ’
2449
2450 Write (10 , * ) ’ s e t s i z e 1 ,0.49 ’
2451 Write (10 , * ) ’ s e t o r i g i n 0.0 ,0.49 ’
2452
2453 W r i t e ( 1 0 , * ) ’ s e t t i t l e ’ / / ’ " { / : Bold ’ / / t i t l e 2 / / ’ } " f o n t " , 2 2 " ’
2454 Write (10 , * ) ’ unset x l a b e l ’
2455 W r i t e ( 1 0 , * ) ’ s e t y l a b e l ’ / / ’ " ’ / / Trim ( y l a b e l 3 ) / / ’ " f o n t " , 2 2 " ’
2456 W r i t e ( 1 0 , * ) ’ s e t y 2 l a b e l ’ / / ’ " ’ / / Trim ( y l a b e l 4 ) / / ’ " f o n t " , 2 2 " ’
2457 Write (10 , * ) ’ unset x t i c s ’
2458 Write (10 , * ) ’ unset x 2 t i c s ’
2459 W r i t e ( 1 0 , ’ (A) ’ ) ’ s e t y r a n g e [ 0 : 3 0 ] ’
2460 W r i t e ( 1 0 , ’ (A) ’ ) ’ s e t y t i c s 0 , 5 , 3 0 n o m i r r o r ’
2461 W r i t e ( 1 0 , ’ (A) ’ ) ’ s e t y 2 r a n g e [ 0 : 1 . 2 ] ’
2462 W r i t e ( 1 0 , ’ (A) ’ ) ’ s e t y 2 t i c s 0 , 0 . 2 , 1 . 2 n o m i r r o r ’
2463
2464 W r i t e ( 1 0 , * ) ’ s e t key L e f t l e f t b o t t o m o p a q u e box f o n t " , 2 0 " ’
2465 W r i t e ( 1 0 , * ) ’ s e t g r i d n o x t i c s y t i c s lw 2 ’
2466
2467 W r i t e ( 1 0 , ’ (A) ’ ) ’ s e t x r a n g e [ 0 : 70 ] ’
2468
2469 Call GraphStyle ( Style03 , Layout3 )
2470 Call GraphStyle ( Style04 , Layout4 )
2471 Call GraphStyle ( Style05 , Layout5 )
2472 Call GraphStyle ( Style06 , Layout6 )
2473
2474 W r i t e ( 1 0 , ’ (A) ’ ) ’ s e t a r r o w from 3 8 . 5 , 0 t o 3 8 . 5 , 3 0 f i l l e d n o h e a d l s 0 lw 3 ’
2475
2476 W r i t e ( 1 0 , ’ (A) ’ ) ’ p l o t " x y d a t a 1 . d a t " u s i n g 2 : 5 : x t i c l a b e l s ( 1 ) w i t h ’ / / t r i m ( L a y o u t 3 ) / / ’ t i t l e " ’
/ / TRIM ( g r a p h _ t i t l e 0 3 ) / / ’ " a x e s x1y1 , " x y d a t a 1 . d a t " u s i n g 2 : 6 : x t i c l a b e l s ( 1 ) w i t h ’ / / t r i m (
L a y o u t 4 ) / / ’ t i t l e " ’ / / TRIM ( g r a p h _ t i t l e 0 4 ) / / ’ " a x e s x1y1 , " x y d a t a 1 . d a t " u s i n g 2 : 7 :
x t i c l a b e l s ( 1 ) w i t h ’ / / t r i m ( L a y o u t 5 ) / / ’ t i t l e " ’ / / TRIM ( g r a p h _ t i t l e 0 5 ) / / ’ " a x e s x1y2 , "
x y d a t a 1 . d a t " u s i n g 2 : 8 : x t i c l a b e l s ( 1 ) w i t h ’ / / t r i m ( L a y o u t 6 ) / / ’ t i t l e " ’ / / TRIM (
g r a p h _ t i t l e 0 6 ) / / ’ " a x e s x1y2 ’
2477
2478 CLOSE ( 1 0 , STATUS= ’KEEP ’ )
2479
2480 ! P l o t c u r v e w i t h g n u p l o t and c l e a n u p f i l e s
2481 ! −−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−
2482 C a l l SYSTEM( ’ g n u p l o t gp . t x t ’ )
2483
2484 ! Pause ! To c h e c k t h e gnu f i l e b e f o r e d e l e t i o n i f t h e g r a p h i s n o t a s e x p e c t e d
.
2485
2486 C a l l SYSTEM( ’ d e l gp . t x t ’ )
2487 C a l l SYSTEM( ’ d e l x y d a t a 1 . d a t ’ )
2488
2489 ! Check m e s s a g e
2490 ! −−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−
273
2621
2622 Case ( ’ 1 e ’ )
2623 Layout = ’ l i n e s l s 5 ’
2624 I f ( P r e s e n t ( I n d e x ) ) W r i t e ( Layout , ’ (A, I 2 ) ’ ) ’ l i n e s l s ’ , I n d e x
2625 I f ( P r e s e n t ( I n d e x ) ) Then
2626 W r i t e ( 1 0 , ’ (A, I2 , A) ’ ) ’ s e t s t y l e l i n e ’ , I n d e x , ’ l c r g b " m a g e n t a " l t 1 lw 2 p t 7 p s 1 ’
2627 Else
2628 W r i t e ( 1 0 , ’ (A) ’ ) ’ s e t s t y l e l i n e 5 l c r g b " m a g e n t a " l t 1 lw 2 p t 7 p s 1 ’
2629 End I f
2630
2631 Case ( ’ 1 f ’ )
2632 Layout = ’ l i n e s l s 6 ’
2633 I f ( P r e s e n t ( I n d e x ) ) W r i t e ( Layout , ’ (A, I 2 ) ’ ) ’ l i n e s l s ’ , I n d e x
2634 I f ( P r e s e n t ( I n d e x ) ) Then
2635 W r i t e ( 1 0 , ’ (A, I2 , A) ’ ) ’ s e t s t y l e l i n e ’ , I n d e x , ’ l c r g b " s a n d y b r o w n " l t 1 lw 2 p t 7 p s
1’
2636 Else
2637 W r i t e ( 1 0 , ’ (A) ’ ) ’ s e t s t y l e l i n e 6 l c r g b " s a n d y b r o w n " l t 1 lw 2 p t 7 p s 1 ’
2638 End I f
2639
2640 Case ( ’ 1 g ’ )
2641 Layout = ’ l i n e s l s 7 ’
2642 I f ( P r e s e n t ( I n d e x ) ) W r i t e ( Layout , ’ (A, I 2 ) ’ ) ’ l i n e s l s ’ , I n d e x
2643 I f ( P r e s e n t ( I n d e x ) ) Then
2644 W r i t e ( 1 0 , ’ (A, I2 , A) ’ ) ’ s e t s t y l e l i n e ’ , I n d e x , ’ l c r g b " o r a n g e − r e d " l t 1 lw 2 p t 7 p s
1’
2645 Else
2646 W r i t e ( 1 0 , ’ (A) ’ ) ’ s e t s t y l e l i n e 7 l c r g b " o r a n g e − r e d " l t 1 lw 2 p t 7 p s 1 ’
2647 End I f
2648
2649 Case ( ’ 1 h ’ )
2650 Layout = ’ l i n e s l s 8 ’
2651 I f ( P r e s e n t ( I n d e x ) ) W r i t e ( Layout , ’ (A, I 2 ) ’ ) ’ l i n e s l s ’ , I n d e x
2652 I f ( P r e s e n t ( I n d e x ) ) Then
2653 W r i t e ( 1 0 , ’ (A, I2 , A) ’ ) ’ s e t s t y l e l i n e ’ , I n d e x , ’ l c r g b " s p r i n g − g r e e n " l t 1 lw 2 p t 7
ps 1 ’
2654 Else
2655 W r i t e ( 1 0 , ’ (A) ’ ) ’ s e t s t y l e l i n e 8 l c r g b " s p r i n g − g r e e n " l t 1 lw 2 p t 7 p s 1 ’
2656 End I f
2657
2658 Case ( ’ 1 i ’ )
2659 Layout = ’ l i n e s l s 9 ’
2660 I f ( P r e s e n t ( I n d e x ) ) W r i t e ( Layout , ’ (A, I 2 ) ’ ) ’ l i n e s l s ’ , I n d e x
2661 I f ( P r e s e n t ( I n d e x ) ) Then
2662 W r i t e ( 1 0 , ’ (A, I2 , A) ’ ) ’ s e t s t y l e l i n e ’ , I n d e x , ’ l c r g b " c y a n " l t 1 lw 2 p t 7 p s 1 ’
2663 Else
2664 W r i t e ( 1 0 , ’ (A) ’ ) ’ s e t s t y l e l i n e 9 l c r g b " c y a n " l t 1 lw 2 p t 7 p s 1 ’
2665 End I f
2666
2667 Case ( ’ 1 j ’ )
2668 L a y o u t = ’ l i n e s l s 10 ’
2669 I f ( P r e s e n t ( I n d e x ) ) W r i t e ( Layout , ’ (A, I 2 ) ’ ) ’ l i n e s l s ’ , I n d e x
2670 I f ( P r e s e n t ( I n d e x ) ) Then
2671 W r i t e ( 1 0 , ’ (A, I2 , A) ’ ) ’ s e t s t y l e l i n e ’ , I n d e x , ’ l c r g b " k h a k i " l t 1 lw 2 p t 7 p s 1 ’
2672 Else
2673 W r i t e ( 1 0 , ’ (A) ’ ) ’ s e t s t y l e l i n e 10 l c r g b " k h a k i " l t 1 lw 2 p t 7 p s 1 ’
2674 End I f
2675
2676 Case ( ’ 1 k ’ ) ! Redish
2677 L a y o u t = ’ l i n e s l s 11 ’
2678 I f ( P r e s e n t ( I n d e x ) ) W r i t e ( Layout , ’ (A, I 2 ) ’ ) ’ l i n e s l s ’ , I n d e x
2679 I f ( P r e s e n t ( I n d e x ) ) Then
2680 W r i t e ( 1 0 , ’ (A, I2 , A) ’ ) ’ s e t s t y l e l i n e ’ , I n d e x , ’ l c r g b ’ ’ # d d 1 8 1 f ’ ’ l t 1 lw 3 p t 7 p s 1
’
2681 Else
2682 W r i t e ( 1 0 , ’ (A) ’ ) ’ s e t s t y l e l i n e 11 l c r g b ’ ’ # d d 1 8 1 f ’ ’ l t 1 lw 3 p t 7 p s 1 ’
2683 End I f
2684
2685 Case ( ’ 1 l ’ )
2686 L a y o u t = ’ l i n e s l s 12 ’
2687 I f ( P r e s e n t ( I n d e x ) ) W r i t e ( Layout , ’ (A, I 2 ) ’ ) ’ l i n e s l s ’ , I n d e x
276 F. Code of the MarsdiepVisual Program
2688 I f ( P r e s e n t ( I n d e x ) ) Then
2689 W r i t e ( 1 0 , ’ (A, I2 , A) ’ ) ’ s e t s t y l e l i n e ’ , I n d e x , ’ l c r g b " d a r k − b l u e " l t 1 lw 3 p t 7 p s 1
’
2690 Else
2691 W r i t e ( 1 0 , ’ (A) ’ ) ’ s e t s t y l e l i n e 12 l c r g b " d a r k − b l u e " l t 1 lw 3 p t 7 p s 1 ’
2692 End I f
2693
2694 Case ( ’ 1m’ )
2695 L a y o u t = ’ l i n e s l s 13 ’
2696 I f ( P r e s e n t ( I n d e x ) ) W r i t e ( Layout , ’ (A, I 2 ) ’ ) ’ l i n e s l s ’ , I n d e x
2697 I f ( P r e s e n t ( I n d e x ) ) Then
2698 W r i t e ( 1 0 , ’ (A, I2 , A) ’ ) ’ s e t s t y l e l i n e ’ , I n d e x , ’ l c r g b " o r a n g e " l t 1 lw 3 p t 7 p s 1 ’
2699 Else
2700 W r i t e ( 1 0 , ’ (A) ’ ) ’ s e t s t y l e l i n e 13 l c r g b " o r a n g e " l t 1 lw 3 p t 7 p s 1 ’
2701 End I f
2702
2703 Case ( ’ 1 n ’ )
2704 L a y o u t = ’ l i n e s l s 14 ’
2705 I f ( P r e s e n t ( I n d e x ) ) W r i t e ( Layout , ’ (A, I 2 ) ’ ) ’ l i n e s l s ’ , I n d e x
2706 I f ( P r e s e n t ( I n d e x ) ) Then
2707 W r i t e ( 1 0 , ’ (A, I2 , A) ’ ) ’ s e t s t y l e l i n e ’ , I n d e x , ’ l c r g b " d a r k − g r e e n " l t 1 lw 3 p t 7 p s
1’
2708 Else
2709 W r i t e ( 1 0 , ’ (A) ’ ) ’ s e t s t y l e l i n e 14 l c r g b " d a r k − g r e e n " l t 1 lw 3 p t 7 p s 1 ’
2710 End I f
2711
2712 Case ( ’ 1 o ’ )
2713 L a y o u t = ’ l i n e s l s 15 ’
2714 I f ( P r e s e n t ( I n d e x ) ) W r i t e ( Layout , ’ (A, I 2 ) ’ ) ’ l i n e s l s ’ , I n d e x
2715 I f ( P r e s e n t ( I n d e x ) ) Then
2716 W r i t e ( 1 0 , ’ (A, I2 , A) ’ ) ’ s e t s t y l e l i n e ’ , I n d e x , ’ l c r g b " m a g e n t a " l t 1 lw 3 p t 7 p s 1 ’
2717 Else
2718 W r i t e ( 1 0 , ’ (A) ’ ) ’ s e t s t y l e l i n e 15 l c r g b " m a g e n t a " l t 1 lw 3 p t 7 p s 1 ’
2719 End I f
2720
2721 Case ( ’ 1 p ’ )
2722 L a y o u t = ’ l i n e s l s 16 ’
2723 I f ( P r e s e n t ( I n d e x ) ) W r i t e ( Layout , ’ (A, I 2 ) ’ ) ’ l i n e s l s ’ , I n d e x
2724 I f ( P r e s e n t ( I n d e x ) ) Then
2725 W r i t e ( 1 0 , ’ (A, I2 , A) ’ ) ’ s e t s t y l e l i n e ’ , I n d e x , ’ l c r g b " s a n d y b r o w n " l t 1 lw 3 p t 7 p s
1’
2726 Else
2727 W r i t e ( 1 0 , ’ (A) ’ ) ’ s e t s t y l e l i n e 16 l c r g b " s a n d y b r o w n " l t 1 lw 3 p t 7 p s 1 ’
2728 End I f
2729
2730 Case ( ’ 1 q ’ )
2731 L a y o u t = ’ l i n e s l s 17 ’
2732 I f ( P r e s e n t ( I n d e x ) ) W r i t e ( Layout , ’ (A, I 2 ) ’ ) ’ l i n e s l s ’ , I n d e x
2733
2734 I f ( P r e s e n t ( I n d e x ) ) Then
2735 W r i t e ( 1 0 , ’ (A, I2 , A) ’ ) ’ s e t s t y l e l i n e ’ , I n d e x , ’ l c r g b " o r a n g e − r e d " l t 1 lw 3 p t 7 p s
1’
2736 Else
2737 W r i t e ( 1 0 , ’ (A) ’ ) ’ s e t s t y l e l i n e 17 l c r g b " o r a n g e − r e d " l t 1 lw 3 p t 7 p s 1 ’
2738 End I f
2739
2740 Case ( ’ 1 r ’ )
2741 L a y o u t = ’ l i n e s l s 18 ’
2742 I f ( P r e s e n t ( I n d e x ) ) W r i t e ( Layout , ’ (A, I 2 ) ’ ) ’ l i n e s l s ’ , I n d e x
2743 I f ( P r e s e n t ( I n d e x ) ) Then
2744 W r i t e ( 1 0 , ’ (A, I2 , A) ’ ) ’ s e t s t y l e l i n e ’ , I n d e x , ’ l c r g b " s p r i n g − g r e e n " l t 1 lw 3 p t 7
ps 1 ’
2745 Else
2746 W r i t e ( 1 0 , ’ (A) ’ ) ’ s e t s t y l e l i n e 18 l c r g b " s p r i n g − g r e e n " l t 1 lw 3 p t 7 p s 1 ’
2747 End I f
2748
2749 Case ( ’ 1 s ’ )
2750 L a y o u t = ’ l i n e s l s 19 ’
2751 I f ( P r e s e n t ( I n d e x ) ) W r i t e ( Layout , ’ (A, I 2 ) ’ ) ’ l i n e s l s ’ , I n d e x
2752 I f ( P r e s e n t ( I n d e x ) ) Then
2753 W r i t e ( 1 0 , ’ (A, I2 , A) ’ ) ’ s e t s t y l e l i n e ’ , I n d e x , ’ l c r g b " c y a n " l t 1 lw 3 p t 7 p s 1 ’
277
2754 Else
2755 W r i t e ( 1 0 , ’ (A) ’ ) ’ s e t s t y l e l i n e 19 l c r g b " c y a n " l t 1 lw 3 p t 7 p s 1 ’
2756 End I f
2757
2758 Case ( ’ 1 t ’ )
2759 L a y o u t = ’ l i n e s l s 20 ’
2760 I f ( P r e s e n t ( I n d e x ) ) W r i t e ( Layout , ’ (A, I 2 ) ’ ) ’ l i n e s l s ’ , I n d e x
2761 I f ( P r e s e n t ( I n d e x ) ) Then
2762 W r i t e ( 1 0 , ’ (A, I2 , A) ’ ) ’ s e t s t y l e l i n e ’ , I n d e x , ’ l c r g b " k h a k i " l t 1 lw 3 p t 7 p s 1 ’
2763 Else
2764 W r i t e ( 1 0 , ’ (A) ’ ) ’ s e t s t y l e l i n e 20 l c r g b " k h a k i " l t 1 lw 3 p t 7 p s 1 ’
2765 End I f
2766
2767 Case ( ’ 1 u ’ )
2768 L a y o u t = ’ l i n e s l s 21 ’
2769 I f ( P r e s e n t ( I n d e x ) ) W r i t e ( Layout , ’ (A, I 2 ) ’ ) ’ l i n e s l s ’ , I n d e x
2770 I f ( P r e s e n t ( I n d e x ) ) Then
2771 W r i t e ( 1 0 , ’ (A, I2 , A) ’ ) ’ s e t s t y l e l i n e ’ , I n d e x , ’ l c r g b " b i s q u e " l t 1 lw 3 p t 7 p s 1 ’
2772 Else
2773 W r i t e ( 1 0 , ’ (A) ’ ) ’ s e t s t y l e l i n e 21 l c r g b " b i s q u e " l t 1 lw 3 p t 7 p s 1 ’
2774 End I f
2775
2776 Case ( ’ 1 v ’ )
2777 L a y o u t = ’ l i n e s l s 22 ’
2778 I f ( P r e s e n t ( I n d e x ) ) W r i t e ( Layout , ’ (A, I 2 ) ’ ) ’ l i n e s l s ’ , I n d e x
2779 I f ( P r e s e n t ( I n d e x ) ) Then
2780 W r i t e ( 1 0 , ’ (A, I2 , A) ’ ) ’ s e t s t y l e l i n e ’ , I n d e x , ’ l c r g b " plum " l t 1 lw 3 p t 7 p s 1 ’
2781 Else
2782 W r i t e ( 1 0 , ’ (A) ’ ) ’ s e t s t y l e l i n e 22 l c r g b " plum " l t 1 lw 3 p t 7 p s 1 ’
2783 End I f
2784
2785 Case ( ’ 1w ’ )
2786 L a y o u t = ’ l i n e s l s 23 ’
2787 I f ( P r e s e n t ( I n d e x ) ) W r i t e ( Layout , ’ (A, I 2 ) ’ ) ’ l i n e s l s ’ , I n d e x
2788 I f ( P r e s e n t ( I n d e x ) ) Then
2789 W r i t e ( 1 0 , ’ (A, I2 , A) ’ ) ’ s e t s t y l e l i n e ’ , I n d e x , ’ l c r g b " medium − b l u e " l t 1 lw 3 p t 7 p s
1’
2790 Else
2791 W r i t e ( 1 0 , ’ (A) ’ ) ’ s e t s t y l e l i n e 23 l c r g b " medium − b l u e " l t 1 lw 3 p t 7 p s 1 ’
2792 End I f
2793
2794 Case ( ’ 1 x ’ )
2795 L a y o u t = ’ l i n e s l s 24 ’
2796 I f ( P r e s e n t ( I n d e x ) ) W r i t e ( Layout , ’ (A, I 2 ) ’ ) ’ l i n e s l s ’ , I n d e x
2797 I f ( P r e s e n t ( I n d e x ) ) Then
2798 W r i t e ( 1 0 , ’ (A, I2 , A) ’ ) ’ s e t s t y l e l i n e ’ , I n d e x , ’ l c r g b " d a r k − o r a n g e " l t 1 lw 3 p t 7 p s
1’
2799 Else
2800 W r i t e ( 1 0 , ’ (A) ’ ) ’ s e t s t y l e l i n e 24 l c r g b " d a r k − o r a n g e " l t 1 lw 3 p t 7 p s 1 ’
2801 End I f
2802
2803 Case ( ’ 1 y ’ )
2804 L a y o u t = ’ l i n e s l s 25 ’
2805 I f ( P r e s e n t ( I n d e x ) ) W r i t e ( Layout , ’ (A, I 2 ) ’ ) ’ l i n e s l s ’ , I n d e x
2806 I f ( P r e s e n t ( I n d e x ) ) Then
2807 W r i t e ( 1 0 , ’ (A, I2 , A) ’ ) ’ s e t s t y l e l i n e ’ , I n d e x , ’ l c r g b " d a r k − plum " l t 1 lw 3 p t 7 p s 1
’
2808 Else
2809 W r i t e ( 1 0 , ’ (A) ’ ) ’ s e t s t y l e l i n e 25 l c r g b " d a r k − plum " l t 1 lw 3 p t 7 p s 1 ’
2810 End I f
2811
2812 Case ( ’ 1 z ’ )
2813 L a y o u t = ’ l i n e s l s 26 ’
2814 I f ( P r e s e n t ( I n d e x ) ) W r i t e ( Layout , ’ (A, I 2 ) ’ ) ’ l i n e s l s ’ , I n d e x
2815 I f ( P r e s e n t ( I n d e x ) ) Then
2816 W r i t e ( 1 0 , ’ (A, I2 , A) ’ ) ’ s e t s t y l e l i n e ’ , I n d e x , ’ l c r g b " d a r k − g o l d e n r o d " l t 1 lw 3 p t 7
ps 1 ’
2817 Else
2818 W r i t e ( 1 0 , ’ (A) ’ ) ’ s e t s t y l e l i n e 26 l c r g b " d a r k − g o l d e n r o d " l t 1 lw 3 p t 7 p s 1 ’
2819 End I f
2820
278 F. Code of the MarsdiepVisual Program
2821
2822 Case ( ’ 2 a ’ )
2823 Layout = ’ lp l s 1 ’
2824 W r i t e ( 1 0 , ’ (A) ’ ) ’ s e t s t y l e l i n e 1 l c r g b " r e d " l t 1 lw 2 p t 7 p s 1 ’
2825
2826 Case ( ’ 2 b ’ )
2827 Layout = ’ lp l s 2 ’
2828 W r i t e ( 1 0 , ’ (A) ’ ) ’ s e t s t y l e l i n e 2 l c r g b " d a r k − b l u e " l t 1 lw 2 p t 7 p s 1 ’
2829
2830 Case ( ’ 2 c ’ )
2831 Layout = ’ lp l s 3 ’
2832 W r i t e ( 1 0 , ’ (A) ’ ) ’ s e t s t y l e l i n e 3 l c r g b " o r a n g e " l t 1 lw 2 p t 7 p s 1 ’
2833
2834 Case ( ’ 2 d ’ )
2835 Layout = ’ lp l s 4 ’
2836 W r i t e ( 1 0 , ’ (A) ’ ) ’ s e t s t y l e l i n e 4 l c r g b " d a r k − b l u e " l t 1 lw 3 p t 7 p s 2 ’
2837
2838 Case ( ’ 2 e ’ )
2839 Layout = ’ lp l s 5 ’
2840 W r i t e ( 1 0 , ’ (A) ’ ) ’ s e t s t y l e l i n e 5 l c r g b " d a r k − r e d " l t 1 lw 2 p t 7 p s 1 ’
2841
2842 Case ( ’ 2 f ’ )
2843 Layout = ’ lp l s 6 ’
2844 W r i t e ( 1 0 , ’ (A) ’ ) ’ s e t s t y l e l i n e 6 l c r g b " o r a n g e − r e d " l t 1 lw 2 p t 7 p s 1 ’
2845
2846 Case ( ’ 2 g ’ )
2847 Layout = ’ lp l s 7 ’
2848 W r i t e ( 1 0 , ’ (A) ’ ) ’ s e t s t y l e l i n e 7 l c r g b " t a n 1 " l t 1 lw 2 p t 7 p s 1 ’
2849
2850 Case ( ’ 2 h ’ )
2851 Layout = ’ lp l s 8 ’
2852 W r i t e ( 1 0 , ’ (A) ’ ) ’ s e t s t y l e l i n e 8 l c r g b " d a r k − g r e e n " l t 1 lw 2 p t 7 p s 1 ’
2853
2854 Case ( ’ 2 i ’ )
2855 Layout = ’ lp l s 9 ’
2856 W r i t e ( 1 0 , ’ (A) ’ ) ’ s e t s t y l e l i n e 9 l c r g b " g r e e n " l t 1 lw 2 p t 7 p s 1 ’
2857
2858 Case ( ’ 2 j ’ )
2859 L a y o u t = ’ l p l s 10 ’
2860 W r i t e ( 1 0 , ’ (A) ’ ) ’ s e t s t y l e l i n e 10 l c r g b " c h a r t r e u s e " l t 1 lw 2 p t 7 p s 1 ’
2861
2862 Case ( ’ 2 k ’ )
2863 L a y o u t = ’ l p l s 11 ’
2864 W r i t e ( 1 0 , ’ (A) ’ ) ’ s e t s t y l e l i n e 11 l c r g b " d a r k − g o l d e n r o d " l t 1 lw 2 p t 7 p s 1 ’
2865
2866 Case ( ’ 2 l ’ )
2867 L a y o u t = ’ l p l s 12 ’
2868 W r i t e ( 1 0 , ’ (A) ’ ) ’ s e t s t y l e l i n e 12 l c r g b " o r a n g e " l t 1 lw 2 p t 7 p s 1 ’
2869
2870 Case ( ’ 2m’ )
2871 L a y o u t = ’ l p l s 13 ’
2872 W r i t e ( 1 0 , ’ (A) ’ ) ’ s e t s t y l e l i n e 13 l c r g b " g o l d " l t 1 lw 2 p t 7 p s 1 ’
2873
2874 Case ( ’ 2 n ’ )
2875 L a y o u t = ’ l p l s 13 ’
2876 W r i t e ( 1 0 , ’ (A) ’ ) ’ s e t s t y l e l i n e 13 l c r g b " o r a n g e − r e d " l t 1 lw 1 p t 7 p s 2 ’
2877
2878 Case ( ’ 2 o ’ )
2879 L a y o u t = ’ l p l s 12 ’
2880 W r i t e ( 1 0 , ’ (A) ’ ) ’ s e t s t y l e l i n e 12 l c r g b " web− g r e e n " l t 1 lw 1 p t 7 p s 2 ’
2881
2882
2883 Case ( ’ 3 a ’ )
2884 Layout = ’ p o i n t s l s 1 ’
2885 W r i t e ( 1 0 , ’ (A) ’ ) ’ s e t s t y l e l i n e 1 l c r g b " r e d " l t 1 lw 3 p t 6 p s 2 ’
2886
2887 Case ( ’ 3 b ’ )
2888 Layout = ’ p o i n t s l s 2 ’
2889 W r i t e ( 1 0 , ’ (A) ’ ) ’ s e t s t y l e l i n e 2 l c r g b " d a r k − b l u e " l t 1 lw 3 p t 6 p s 2 ’
2890
2891 Case ( ’ 3 c ’ )
279
2892 Layout = ’ p o i n t s l s 3 ’
2893 W r i t e ( 1 0 , ’ (A) ’ ) ’ s e t s t y l e l i n e 3 l c r g b " o r a n g e " l t 1 lw 3 p t 6 p s 2 ’
2894
2895 Case ( ’ 3 d ’ )
2896 Layout = ’ p o i n t s l s 4 ’
2897 W r i t e ( 1 0 , ’ (A) ’ ) ’ s e t s t y l e l i n e 4 l c r g b " d a r k − g r e e n " l t 1 lw 1 p t 6 p s 2 ’
2898
2899 Case ( ’ 3 e ’ )
2900 Layout = ’ p o i n t s l s 5 ’
2901 W r i t e ( 1 0 , ’ (A) ’ ) ’ s e t s t y l e l i n e 5 l c r g b " m a g e n t a " l t 1 lw 1 p t 6 p s 2 ’
2902
2903 Case ( ’ 3 f ’ )
2904 Layout = ’ p o i n t s l s 6 ’
2905 W r i t e ( 1 0 , ’ (A) ’ ) ’ s e t s t y l e l i n e 6 l c r g b " s a n d y b r o w n " l t 1 lw 1 p t 6 p s 2 ’
2906
2907 Case ( ’ 3 g ’ )
2908 Layout = ’ p o i n t s l s 7 ’
2909 W r i t e ( 1 0 , ’ (A) ’ ) ’ s e t s t y l e l i n e 7 l c r g b " o r a n g e − r e d " l t 1 lw 1 p t 6 p s 2 ’
2910
2911 Case ( ’ 3 h ’ )
2912 Layout = ’ p o i n t s l s 8 ’
2913 W r i t e ( 1 0 , ’ (A) ’ ) ’ s e t s t y l e l i n e 8 l c r g b " s p r i n g − g r e e n " l t 1 lw 1 p t 6 p s 2 ’
2914
2915 Case ( ’ 3 i ’ )
2916 Layout = ’ p o i n t s l s 9 ’
2917 W r i t e ( 1 0 , ’ (A) ’ ) ’ s e t s t y l e l i n e 9 l c r g b " c y a n " l t 1 lw 1 p t 6 p s 2 ’
2918
2919 Case ( ’ 3 j ’ )
2920 L a y o u t = ’ p o i n t s l s 10 ’
2921 W r i t e ( 1 0 , ’ (A) ’ ) ’ s e t s t y l e l i n e 10 l c r g b " k h a k i " l t 1 lw 1 p t 6 p s 2 ’
2922
2923 Case ( ’ 3 k ’ )
2924 L a y o u t = ’ p o i n t s l s 11 ’
2925 W r i t e ( 1 0 , ’ (A) ’ ) ’ s e t s t y l e l i n e 11 l c r g b " r e d " l t 1 lw 1 p t 6 p s 2 ’
2926
2927 Case ( ’ 3 l ’ )
2928 L a y o u t = ’ p o i n t s l s 12 ’
2929 W r i t e ( 1 0 , ’ (A) ’ ) ’ s e t s t y l e l i n e 12 l c r g b " d a r k − b l u e " l t 1 lw 1 p t 6 p s 2 ’
2930
2931 Case ( ’ 3m’ )
2932 L a y o u t = ’ p o i n t s l s 13 ’
2933 W r i t e ( 1 0 , ’ (A) ’ ) ’ s e t s t y l e l i n e 13 l c r g b " r e d " l t 1 lw 1 p t 7 p s 3 ’
2934
2935 Case ( ’ 3 n ’ )
2936 L a y o u t = ’ p o i n t s l s 14 ’
2937 W r i t e ( 1 0 , ’ (A) ’ ) ’ s e t s t y l e l i n e 14 l c r g b " d a r k − b l u e " l t 1 lw 1 p t 7 p s 3 ’
2938
2939 Case ( ’ 3 o ’ )
2940 L a y o u t = ’ p o i n t s l s 15 ’
2941 W r i t e ( 1 0 , ’ (A) ’ ) ’ s e t s t y l e l i n e 15 l c r g b " c h a r t r e u s e " l t 1 lw 1 p t 7 p s 3 ’
2942
2943 Case ( ’ 3 p ’ )
2944 L a y o u t = ’ p o i n t s l s 16 ’
2945 W r i t e ( 1 0 , ’ (A) ’ ) ’ s e t s t y l e l i n e 16 l c r g b " d a r k − g r e e n " l t 1 lw 1 p t 7 p s 3 ’
2946
2947 Case ( ’ 3 q ’ )
2948 L a y o u t = ’ p o i n t s l s 17 ’
2949 W r i t e ( 1 0 , ’ (A) ’ ) ’ s e t s t y l e l i n e 17 l c r g b " m a g e n t a " l t 1 lw 1 p t 7 p s 3 ’
2950
2951 Case ( ’ 3 r ’ )
2952 L a y o u t = ’ p o i n t s l s 18 ’
2953 W r i t e ( 1 0 , ’ (A) ’ ) ’ s e t s t y l e l i n e 18 l c r g b " s a n d y b r o w n " l t 1 lw 1 p t 7 p s 3 ’
2954
2955 Case ( ’ 3 s ’ )
2956 L a y o u t = ’ p o i n t s l s 19 ’
2957 W r i t e ( 1 0 , ’ (A) ’ ) ’ s e t s t y l e l i n e 19 l c r g b " c y a n " l t 1 lw 1 p t 7 p s 3 ’
2958
2959 Case ( ’ 3 t ’ )
2960 L a y o u t = ’ p o i n t s l s 20 ’
2961 W r i t e ( 1 0 , ’ (A) ’ ) ’ s e t s t y l e l i n e 20 l c r g b " o r a n g e " l t 1 lw 1 p t 7 p s 3 ’
2962
280 F. Code of the MarsdiepVisual Program
2963 Case ( ’ 3 u ’ )
2964 L a y o u t = ’ p o i n t s l s 21 ’
2965 W r i t e ( 1 0 , ’ (A) ’ ) ’ s e t s t y l e l i n e 21 l c r g b " d a r k − v i o l e t " l t 1 lw 1 p t 7 p s 3 ’
2966
2967 Case ( ’ 3 v ’ )
2968 L a y o u t = ’ p o i n t s l s 22 ’
2969 W r i t e ( 1 0 , ’ (A) ’ ) ’ s e t s t y l e l i n e 22 l c r g b " d a r k − g r e e n " l t 1 lw 3 p t 6 p s 2 ’
2970
2971 Case ( ’ 3w ’ )
2972 L a y o u t = ’ p o i n t s l s 23 ’
2973 W r i t e ( 1 0 , ’ (A) ’ ) ’ s e t s t y l e l i n e 23 l c r g b " o r a n g e − r e d " l t 1 lw 1 p t 7 p s 3 ’
2974
2975 Case ( ’ 3 x ’ )
2976 L a y o u t = ’ p o i n t s l s 24 ’
2977 W r i t e ( 1 0 , ’ (A) ’ ) ’ s e t s t y l e l i n e 24 l c r g b " c h a r t r e u s e " l t 1 lw 3 p t 6 p s 2 ’
2978
2979 Case ( ’ 3 y ’ )
2980 L a y o u t = ’ p o i n t s l s 25 ’
2981 W r i t e ( 1 0 , ’ (A) ’ ) ’ s e t s t y l e l i n e 25 l c r g b " d a r k − r e d " l t 1 lw 3 p t 6 p s 2 ’
2982
2983 Case ( ’ 3 z ’ )
2984 L a y o u t = ’ p o i n t s l s 26 ’
2985 W r i t e ( 1 0 , ’ (A) ’ ) ’ s e t s t y l e l i n e 26 l c r g b " d a r k − g r e e n " l t 1 lw 3 p t 6 p s 2 ’
2986
2987
2988 Case ( ’ 4 a ’ )
2989 Layout = ’ c i r c l e s l s 1 ’
2990 W r i t e ( 1 0 , ’ (A) ’ ) ’ s e t s t y l e l i n e 1 l c r g b " g r a y " lw 3 ’
2991
2992 Case ( ’ 4 b ’ )
2993 Layout = ’ c i r c l e s l s 2 ’
2994 W r i t e ( 1 0 , ’ (A) ’ ) ’ s e t s t y l e l i n e 2 l c r g b " r e d " lw 3 ’
2995
2996 Case ( ’ 4 c ’ )
2997 Layout = ’ c i r c l e s l s 3 ’
2998 W r i t e ( 1 0 , ’ (A) ’ ) ’ s e t s t y l e l i n e 3 l c r g b " l i g h t − g r e e n " lw 3 ’
2999
3000 Case ( ’ 4 d ’ )
3001 Layout = ’ c i r c l e s l s 4 ’
3002 W r i t e ( 1 0 , ’ (A) ’ ) ’ s e t s t y l e l i n e 4 l c r g b " p i n k " lw 3 ’
3003
3004 Case ( ’ 4 e ’ )
3005 Layout = ’ c i r c l e s l s 5 ’
3006 W r i t e ( 1 0 , ’ (A) ’ ) ’ s e t s t y l e l i n e 5 l c r g b " d a r k − g r a y " lw 3 ’
3007
3008 Case ( ’ 4 f ’ )
3009 Layout = ’ c i r c l e s l s 6 ’
3010 W r i t e ( 1 0 , ’ (A) ’ ) ’ s e t s t y l e l i n e 6 l c r g b "# d a r k − b l u e " lw 3 ’
3011
3012 Case ( ’ 4 g ’ )
3013 Layout = ’ c i r c l e s l s 7 ’
3014 W r i t e ( 1 0 , ’ (A) ’ ) ’ s e t s t y l e l i n e 7 l c r g b " d a r k − y e l l o w " lw 3 ’
3015
3016 Case ( ’ 4 h ’ )
3017 Layout = ’ c i r c l e s l s 8 ’
3018 W r i t e ( 1 0 , ’ (A) ’ ) ’ s e t s t y l e l i n e 8 l c r g b " o r a n g e " lw 3 ’
3019
3020
3021 Case ( ’ 5 a ’ )
3022 Layout = ’ boxes l s 1 ’
3023 W r i t e ( 1 0 , ’ (A) ’ ) ’ s e t s t y l e l i n e s 1 l c r g b " r e d " lw 3 ’
3024
3025 Case ( ’ 5 b ’ )
3026 Layout = ’ boxes l s 2 ’
3027 W r i t e ( 1 0 , ’ (A) ’ ) ’ s e t s t y l e l i n e s 2 l c r g b " d a r k − b l u e " lw 3 ’
3028
3029
3030 Case D e f a u l t
3031 W r i t e ( * , ’ (A) ’ ) " Graph S t y l e unknown , p r o c e s s a b o r t e d . "
3032 Return
3033
281
3034 End S e l e c t
3035
3036 End S u b r o u t i n e
3037
3038 ! −−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−
3039
3040 End Module V i s u a l M o d u l e
Code/VisualModule.f90